Brush.Companion
-
Cmn
object Brush.Companion
Summary
Public functions |
||
|---|---|---|
Brush.Builder |
builder()Returns a new |
Cmn
|
Brush |
createWithColorIntArgb(Returns a new |
Cmn
|
Brush |
createWithColorLong(Returns a new |
Cmn
|
Extension functions |
||
|---|---|---|
Brush |
Brush.Companion.createWithComposeColor(Returns a new |
android
|
Brush |
@RequiresApi(value = 26)Returns a new |
android
|
Public functions
createWithColorIntArgb
fun createWithColorIntArgb(
family: BrushFamily,
colorIntArgb: @ColorInt Int,
size: Float,
epsilon: Float
): Brush
Returns a new Brush with the color specified by a ColorInt, which is in the sRGB color space by definition. Note that the ColorInt channel order puts alpha first (in the most significant byte).
Kotlin interprets integer literals greater than 0x7fffffff as Longs, so callers that want to specify a literal ColorInt with alpha >= 0x80 must call Long.toInt on the literal.
createWithColorLong
fun createWithColorLong(
family: BrushFamily,
colorLong: @ColorLong Long,
size: Float,
epsilon: Float
): Brush
Returns a new Brush with the color specified by a ColorLong, which can encode several different color spaces. sRGB and Display P3 are supported; a color in any other color space will be converted to Display P3.
Some libraries (notably Jetpack UI Graphics) use ULong for ColorLongs, so the caller must call ULong.toLong on such a value before passing it to this method.
Extension functions
Brush.Companion.createWithComposeColor
fun Brush.Companion.createWithComposeColor(
family: BrushFamily,
color: Color,
size: Float,
epsilon: Float
): Brush
Returns a new Brush with the color specified by an androidx.compose.ui.graphics.Color value, which can encode several different color spaces. sRGB and Display P3 are supported; a color in any other color space will be converted to Display P3.
Brush.Companion.createWithAndroidColor
@RequiresApi(value = 26)
fun Brush.Companion.createWithAndroidColor(
family: BrushFamily,
color: Color,
size: Float,
epsilon: Float
): Brush
Returns a new Brush with the color specified by an android.graphics.Color instance, which can encode several different color spaces. sRGB and Display P3 are supported; a color in any other color space will be converted to Display P3.
Java callers should prefer BrushUtil.createWithAndroidColor (createBrushWithAndroidColor).