Paint

class Paint : Managed

Constructors

Link copied to clipboard
constructor()

Constructs SkPaint with default values.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var alpha: Int

Retrieves alpha from the color used when stroking and filling.

Link copied to clipboard

Retrieves alpha from the color used when stroking and filling.

Link copied to clipboard

Sets SkBlendMode to mode. Does not check for valid input. BlendMode used to combine source color and destination.

Link copied to clipboard
var color: Int

Sets alpha and RGB used when stroking and filling. The color is a 32-bit value, unpremultiplied, packing 8-bit components for alpha, red, blue, and green.

Link copied to clipboard

Sets alpha and RGB used when stroking and filling. The color is four floating point values, unpremultiplied. The color values are interpreted as being in sRGB.

Link copied to clipboard
Link copied to clipboard

imageFilter how SkImage is sampled when transformed

Link copied to clipboard

Requests, but does not require, that edge pixels draw opaque or with partial transparency.

Link copied to clipboard
expect open val isClosed: Boolean

Check if underlying resource is closed.

Link copied to clipboard

Requests, but does not require, to distribute color error.

Link copied to clipboard
Link copied to clipboard

maskFilter modifies clipping mask generated from drawn geometry

Link copied to clipboard

Sets whether the geometry is filled, stroked, or filled and stroked.

Link copied to clipboard

Replace Path with a modification when drawn

Link copied to clipboard
Link copied to clipboard

Sets the geometry drawn at the beginning and end of strokes.

Link copied to clipboard

Sets the geometry drawn at the corners of strokes.

Link copied to clipboard

Sets the limit at which a sharp corner is drawn beveled. Valid values are zero and greater. Has no effect if miter is less than zero.

Link copied to clipboard

Sets the thickness of the pen used by the paint to outline the shape. A stroke-width of zero is treated as "hairline" width. Hairlines are always exactly one pixel wide in device space (their thickness does not change as the canvas is scaled). Negative stroke-widths are invalid; setting a negative width will have no effect.

Functions

Link copied to clipboard
expect open fun close()

Free underlying native resource, peer is useless afterwards.

Link copied to clipboard

Returns true if Paint prevents all drawing; otherwise, the Paint may or may not allow drawing.

Link copied to clipboard

Makes a shallow copy of Paint. PathEffect, Shader, MaskFilter, ColorFilter, and ImageFilter are shared between the original paint and the copy.

Link copied to clipboard
fun reset(): Paint

Sets all Paint contents to their initial values. This is equivalent to replacing Paint with the result of Paint().

Link copied to clipboard

Replaces alpha, leaving RGB unchanged. An out of range value triggers an assert in the debug build. a is a value from 0f to 1f.

Link copied to clipboard
fun setARGB(a: Int, r: Int, g: Int, b: Int): Paint

Sets color used when drawing solid fills. The color components range from 0 to 255. The color is unpremultiplied; alpha sets the transparency independent of RGB.

Link copied to clipboard
fun setColor4f(color: Color4f, colorSpace: ColorSpace?): Paint

Sets alpha and RGB used when stroking and filling. The color is four floating point values, unpremultiplied. The color values are interpreted as being in the colorSpace. If colorSpace is nullptr, then color is assumed to be in the sRGB color space.

Link copied to clipboard
fun setStroke(value: Boolean): Paint

Set paint's mode to STROKE if true, or FILL if false.

Link copied to clipboard
expect open override fun toString(): String