androidx.ink.brush
Interfaces
TextureBitmapStore |
Interface for a callback to allow the caller to provide a particular |
android
|
Classes
Brush |
Defines how stroke inputs are interpreted to create the visual representation of a stroke. |
android
|
Brush.Builder |
Builder for |
android
|
BrushFamily |
A |
android
|
InputToolType |
The type of input tool used in producing |
android
|
Objects
Brush.Companion |
android
|
|
BrushFamily.Companion |
android
|
|
StockBrushes |
Provides a fixed set of stock |
android
|
Annotations
ExperimentalInkCustomBrushApi |
Marks declarations that are are part of the experimental Ink brush customization API. |
android
|
Top-level functions summary
Brush |
@RequiresApi(value = 26) Returns a new |
android
|
Extension functions summary
Brush |
@RequiresApi(value = 26) Creates a copy of |
android
|
Color |
@RequiresApi(value = 26) The brush color as an |
android
|
Brush |
@RequiresApi(value = 26) Returns a new |
android
|
Brush.Builder |
@RequiresApi(value = 26) Set the color on a |
android
|
Top-level functions
createBrushWithAndroidColor
@RequiresApi(value = 26)
fun createBrushWithAndroidColor(
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.
Kotlin callers should prefer Brush.Companion.createWithAndroidColor
.
Extension functions
copyWithAndroidColor
@RequiresApi(value = 26)
fun Brush.copyWithAndroidColor(
color: Color,
family: BrushFamily = this.family,
size: Float = this.size,
epsilon: Float = this.epsilon
): Brush
Creates a copy of this
Brush
and allows named properties to be altered while keeping the rest unchanged. The color is specified as 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.
createAndroidColor
@RequiresApi(value = 26)
fun Brush.createAndroidColor(): Color
The brush color as an android.graphics.Color
instance, which can express colors in several different color spaces. sRGB and Display P3 are supported; a color in any other color space will be converted to Display P3.
Unless an instance of android.graphics.Color
is actually needed, prefer to use Brush.colorLong
to get the color without causing an allocation, especially in performance-sensitive code. Brush.colorLong
is fully compatible with the Long
representation of android.graphics.Color
.
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
).
setAndroidColor
@RequiresApi(value = 26)
fun Brush.Builder.setAndroidColor(color: Color): Brush.Builder
Set the color on a Brush.Builder
as an android.graphics.Color
instance. sRGB and Display P3 are supported; a color in any other color space will be converted to Display P3.