fromAlpha

fun fromAlpha(color: Color, alpha: Double, result: Color? = definedExternally): Color(source)

Creates a new Color that has the same red, green, and blue components of the specified color, but with the specified alpha value.

const translucentRed = Color.fromAlpha(Color.RED, 0.9);

Return

The modified result parameter or a new Color instance if one was not provided.

Parameters

color

The base color

alpha

The new alpha component.

result

The object onto which to store the result.

See also