Skip to content

Latest commit

 

History

History
136 lines (96 loc) · 4.27 KB

File metadata and controls

136 lines (96 loc) · 4.27 KB

Color

Kind: global interface

color.name : String

[DEPRECARED] Formatted name of the color, only exists on project colors. Please use Color.originalName and Color.getFormattedName instead.

Kind: instance property of Color

color.originalName : String

Name of the color, only exists on project colors. To check if a color (e.g. from a layer) exists in the project, see Project.findColorEqual.

Kind: instance property of Color

color.r : Number

Red component of the color, [0, 255].

Kind: instance property of Color

color.g : Number

Green component of the color, [0, 255].

Kind: instance property of Color

color.b : Number

Blue component of the color, [0, 255].

Kind: instance property of Color

color.a : Number

Alpha component of the color, [0, 1].

Kind: instance property of Color

color.sourceId : String

Id of the color in the source design document.

Kind: instance property of Color

color.equals(c) ⇒ Boolean

Checks whether another color is equal to this one.

Kind: instance method of Color

Param Type Description
c Color Color object to be compared.

color.getFormattedName(namingScheme) ⇒ String

Formats the original name according to the provided naming scheme.

Kind: instance method of Color

Param Type Description
namingScheme "snake" | "camel" | "pascal" | "kebab" | "constant" Naming scheme to format the name ("constant" by default).

color.blend(c) ⇒ Color

Blends another color with this one, via alpha compositing.

Kind: instance method of Color

Param Type Description
c Color Color object to be blended.

color.toHex() ⇒ Object

Hex representation of the color.

Kind: instance method of Color

Properties

Name Type
r Number
g Number
b Number
a Number

color.toHSL() ⇒ Object

HSLA representation of the color, e.g. hsla(..., a) or hsl(...).

Kind: instance method of Color

Properties

Name Type
h Number
s Number
l Number

Color.blendAll(colors) ⇒ Color

Blends multiple colors.

Kind: static method of Color

Param Type Description
colors Array<Color> List of color objects to be blended.