Kind: global interface
- Color
- instance
- .name :
String
- .originalName :
String
- .r :
Number
- .g :
Number
- .b :
Number
- .a :
Number
- .sourceId :
String
- .getFormattedName(namingScheme) ⇒
String
- .equals(c) ⇒
Boolean
- .blend(c) ⇒
Color
- .toHex() ⇒
Object
- .toHSL() ⇒
Object
- .name :
- static
- instance
[DEPRECARED]
Formatted name of the color, only exists on project colors. Please use Color.originalName
and Color.getFormattedName
instead.
Kind: instance property of Color
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
Red component of the color, [0, 255].
Kind: instance property of Color
Green component of the color, [0, 255].
Kind: instance property of Color
Blue component of the color, [0, 255].
Kind: instance property of Color
Alpha component of the color, [0, 1].
Kind: instance property of Color
Id of the color in the source design document.
Kind: instance property of Color
Checks whether another color is equal to this one.
Kind: instance method of Color
Param | Type | Description |
---|---|---|
c | Color |
Color object to be compared. |
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. |
Hex representation of the color.
Kind: instance method of Color
Properties
Name | Type |
---|---|
r | Number |
g | Number |
b | Number |
a | Number |
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. |