ReadonlybThe blue value of the color.
ReadonlygThe green value of the color.
ReadonlyrThe red value of the color.
ReadonlytransparentTransparency of the color.
StaticBLACKSimple black (CSS: rgb(0, 0, 0))
StaticBLUEBlue (CSS: rgb(34, 147, 251))
StaticDARK_Blue (CSS: rgb(36, 131, 199))
StaticDARK_Dark grey (CSS: rgb(64, 64, 64))
StaticGREENGreen (CSS: rgb(110, 176, 0))
StaticGREYGrey (CSS: rgb(128, 128, 128))
StaticLIGHT_Light blue (CSS: rgb(141, 184, 255))
StaticLIGHT_Light green (CSS: rgb(162, 250, 123))
StaticLIGHT_Light grey (CSS: rgb(192, 192, 192))
StaticLIGHT_Light orange (CSS: rgb(255, 139, 94))
StaticLIGHT_Light red (CSS: rgb(247, 141, 138))
StaticLIGHT_Light yellow (CSS: rgb(252, 238, 124))
StaticMAUVEMauve (CSS: rgb(245, 135, 255))
StaticORANGEOrange (CSS: rgb(243, 149, 0))
StaticPINKPink (CSS: rgb(255, 114, 147))
StaticPURPLEPurple (CSS: rgb(255, 0, 255))
StaticREDRed (CSS: rgb(248, 36, 0))
StaticTRANSPARENTTransparent (CSS: transparent)
StaticWHITESimple white (CSS: rgb(255, 255, 255))
StaticYELLOWYellow (CSS: rgb(255, 255, 0))
Returns a new instance of this Record type with all values set to their default values.
Returns a darker version of the current Color.
The percentage of lightness between 0 and 100.
A Color with the new values.
Returns a new instance of this Record type with the value for the specific key set to its default value.
Returns true if the provided color or object and the current Color have the same RGB values.
Color instance or RGB object.
True if equal, false otherwise.
Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.
If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.
OptionalnotSetValue: anyReturns a lighter version of the current Color.
The percentage of lightness between 0 and 100.
A Color with the new values.
Modifies the saturation of the Color and returns a new one.
The percentage of saturation between 0 and 100.
A Color with the new values.
Deeply converts this Record to equivalent native JavaScript Object.
Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.
The blue value of the color.
The green value of the color.
The red value of the color.
Transparency of the color.
Shallowly converts this Record to equivalent native JavaScript Object.
The blue value of the color.
The green value of the color.
The red value of the color.
Transparency of the color.
Shallowly converts this Record to equivalent JavaScript Object.
The blue value of the color.
The green value of the color.
The red value of the color.
Transparency of the color.
StaticfromConverts a hex color value to a Color instance.
The hex color value to convert.
A Color instance.
Color objects are used in annotations for defining colors. We're using an rgb representation internally with the
r,g,bvalues clipped between0and255inclusive, and atransparentflag that can be used to indicate that the color is transparent, in which case the providedr,g, andbvalues are ignored and set to0in the instantiatedColor.It is an Immutable.Record and thus can be updated using
set(key, value), for example:color.set("r", 255).However, in order to obtain a transparent color the static
TRANSPARENTvalue should be used instead.The difference between using
Color.TRANSPARENTandnullas values for annotation color properties may depend on the context; if the annotation is being created or updated:Color.TRANSPARENT, the color value will be updated and be transparent.null, the color change will not be saved to the document, although it may appear as transparent in the viewer.To avoid inconsistencies, it is recommended to always use
Color.TRANSPARENTinstead ofnullwhen updating annotations.Example
Create and update a color.
Param: color
An object used to initialize the color. If
r,gorbis omitted,0will be used instead.Default