toValue

fun toValue(color: Color, result: Uint8Array? = definedExternally): Uint8Array(source)

Converts a color to a typed array that can be used to assign a color attribute.

const attributes = primitive.getGeometryInstanceAttributes('an id');
attributes.color = ColorGeometryInstanceAttribute.toValue(Color.AQUA, attributes.color);

Return

The modified result parameter or a new instance if result was undefined.

Parameters

color

The color.

result

The array to store the result in, if undefined a new instance will be created.

See also