Defined in package

class Brush

Added in version 6.0.0

Brushes define how objects are drawn on screen and allow to change their fill and stroke color as well as the stroke width. They are, for example, used to change the styling of barcode locations, or other objects drawn on top of the video preview. Brushes are immutable. Once created none of the members can be modified.

static @NonNull Brush transparent()

Added in version 6.1.0

Creates a new brush where both fill and stroke colors are set to fully transparent black. The stroke width is set to zero.

Brush(int fillColor,
        int strokeColor,
        float strokeWidth)

Added in version 6.0.0

Creates a new brush with provided fill, stroke colors and stroke width.

The fillColor and strokeColor arguments should represent a color in an ARGB format.

int getFillColor()

Added in version 6.0.0

The fill color used to draw the object.

int getStrokeColor()

Added in version 6.0.0

The stroke color used to draw the object.

float getStrokeWidth()

Added in version 6.0.0

The width in device-independent pixels used to render the stroke.

boolean equals(@Nullable Object other)

Added in version 6.0.0

Indicates whether some other object is equal to this one.

int hashCode()

Added in version 6.0.0

Returns a hash code value for the object.

copy(fillColor, strokeColor, preserveAlpha)
@NonNull Brush copy(int fillColor,
        int strokeColor,
        boolean preserveAlpha)

Added in version 6.15.0

Returns a brush with the same stroke width, but applies the provided colors and, if the last flag is set to true, keeps the original alpha.