toValue

fun toValue(    color: Color,     result: <Error class: unknown class><out <Error class: unknown class>>? = definedExternally): <Error class: unknown class><out <Error class: unknown class>>(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