ColorImage

actual class ColorImage(val color: Int, val width: Int, val height: Int, val size: Long, val shareable: Boolean)
expect class ColorImage(color: Int = 0xFF000000.toInt(), width: Int = -1, height: Int = -1, size: Long = 0, shareable: Boolean = true) : Image

An image that draws a color.

By default the image has no intrinsic size and will fill its canvas. Set width and height to a positive value to draw a square with those dimensions.

Parameters

color

The ARGB hex color to draw with the format 0xAARRGGBB.toInt(). Tip: Use Compose's color class: ColorImage(Color.Black.toArgb()).

actual class ColorImage(val color: Int, val width: Int, val height: Int, val size: Long, val shareable: Boolean) : Image

Constructors

Link copied to clipboard
actual constructor(color: Int, width: Int, height: Int, size: Long, shareable: Boolean)
expect constructor(color: Int = 0xFF000000.toInt(), width: Int = -1, height: Int = -1, size: Long = 0, shareable: Boolean = true)
actual constructor(color: Int, width: Int, height: Int, size: Long, shareable: Boolean)

Properties

Link copied to clipboard
actual val color: Int
expect val color: Int
actual val color: Int
Link copied to clipboard
actual open val height: Int
expect open override val height: Int

The intrinsic height of the image in pixels or -1 if the image has no intrinsic height.

actual open override val height: Int

The intrinsic height of the image in pixels or -1 if the image has no intrinsic height.

Link copied to clipboard
actual open val shareable: Boolean
expect open override val shareable: Boolean

True if the image can be shared between multiple Targets at the same time.

actual open override val shareable: Boolean

True if the image can be shared between multiple Targets at the same time.

Link copied to clipboard
actual open val size: Long
expect open override val size: Long

The size of the image in memory in bytes.

actual open override val size: Long

The size of the image in memory in bytes.

Link copied to clipboard
actual open val width: Int
expect open override val width: Int

The intrinsic width of the image in pixels or -1 if the image has no intrinsic width.

actual open override val width: Int

The intrinsic width of the image in pixels or -1 if the image has no intrinsic width.

Functions

Link copied to clipboard
expect open override fun draw(canvas: Canvas)

Draw the image to a Canvas.