Companion

object Companion

Functions

Link copied to clipboard
fun create(@ColorInt color: Int, alpha: Float = -1.0f, widthPx: Int? = null, heightPx: Int? = null, style: Style? = null): SolidColor

Java-compatible factory method that accepts pixel values for dimensions. Use this method when calling from Java code with pixel values.

Link copied to clipboard
fun createDp(@ColorInt color: Int, alpha: Float = -1.0f, widthDp: Float? = null, heightDp: Float? = null, style: Style? = null): SolidColor

Java-compatible factory method that accepts dp values for dimensions. Use this method when calling from Java code with dp values (e.g., from .widthDip() or .heightDip() calls).

Link copied to clipboard

Simplified Java-compatible factory method that accepts just color and style. Use this method when calling from Java code that only needs to specify color and style without passing explicit default values for alpha and dimensions.