MaterialResource.setColor() method

Convenience method for setting colors.

Signature:

setColor(color: string, key?: string): this;

Parameters

Parameter

Type

Description

color

string

key

string

(Optional)

**Returns:**

this

Remarks

Without providing the key parameter, the method will attempt to parse and set the color of every color-like procedural material option supported by this material. You may provide the key parameter to set a specific option.

Example

material.setColor('blue');
material.setColor('rgb(255, 100, 50)');
material.setColor('rgba(100, 255, 7, 0.5)');
material.setColor('hsl(50, 80%, 40%)');
material.setColor('#ff00cc');
Get in touch

We'd love to learn more about your vision and how we can help.

PressPrivacyTermsSupportCopyright © 2024 Core3D, Inc. All Rights Reserved.