Represents an ARGB (alpha, red, green, blue) encoded color object.
This is a convertible type that can be used with the following notation(s) in parameter lists, parameter objects or setters.
CSS color strings are converted to Colors. For example:
'blue'
'#369'
'#336699'
'rgb(51, 102, 153)'
'rgba(51, 102, 153, 0.5)'
'hsl(225, 98%, 60%)'
'hsla(225, 98%, 60%, 0.5)'
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.view.Color
Initializes a new instance of the Color class.
options - Object
A map of options to pass to the method.
- r - number
The red value; 0
by default.
- g - number
The green value; 0
by default
- b - number
The blue value; 0
by default.
- a - number
The alpha value; 255
by default.
Gets the value of the alpha component of the color.
The value is between 0 and 255. If this component is 0, then the color will be transparent.
Gets the value of the blue component of the color.
The value is between 0 and 255. A higher value represents a higher part of the color is made up of this component.
Gets the value of the green component of the color.
The value is between 0 and 255. A higher value represents a higher part of the color is made up of this component.
Gets the value of the red component of the color.
The value is between 0 and 255. A higher value represents a higher part of the color is made up of this component.
Determines whether this color is equal to the specified object.
options - Object
A map of options to pass to the method.
- obj - Object
The other.
- ↪boolean
true
, if this color is equal to the other object; false
, otherwise.
Returns a hash code for this instance.
- ↪number
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Yields a new Color for the wellknown name AliceBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name AntiqueWhite.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Aqua.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Aquamarine.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Azure.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Beige.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Bisque.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Black.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name BlanchedAlmond.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Blue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name BlueViolet.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Brown.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name BurlyWood.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name CadetBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Chartreuse.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Chocolate.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Coral.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name CornflowerBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Cornsilk.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Crimson.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Cyan.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkCyan.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkGoldenrod.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkGray.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkKhaki.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkMagenta.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkOliveGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkOrange.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkOrchid.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkRed.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkSalmon.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkSeaGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkSlateBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkSlateGray.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkTurquoise.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DarkViolet.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DeepPink.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DeepSkyBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DimGray.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name DodgerBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Firebrick.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name FloralWhite.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name ForestGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Fuchsia.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Gainsboro.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name GhostWhite.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Gold.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Goldenrod.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Gray.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Green.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name GreenYellow.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Honeydew.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name HotPink.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name IndianRed.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Indigo.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Ivory.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Khaki.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Lavender.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LavenderBlush.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LawnGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LemonChiffon.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightCoral.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightCyan.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightGoldenrodYellow.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightGray.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightPink.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightSalmon.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightSeaGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightSkyBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightSlateGray.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightSteelBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LightYellow.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Lime.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name LimeGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Linen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Magenta.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Maroon.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name MediumAquamarine.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name MediumBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name MediumOrchid.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name MediumPurple.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name MediumSeaGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name MediumSlateBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name MediumSpringGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name MediumTurquoise.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name MediumVioletRed.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name MidnightBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name MintCream.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name MistyRose.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Moccasin.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name NavajoWhite.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Navy.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name OldLace.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Olive.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name OliveDrab.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Orange.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name OrangeRed.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Orchid.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name PaleGoldenrod.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name PaleGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name PaleTurquoise.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name PaleVioletRed.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name PapayaWhip.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name PeachPuff.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Peru.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Pink.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Plum.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name PowderBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Purple.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Red.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name RosyBrown.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name RoyalBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name SaddleBrown.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Salmon.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name SandyBrown.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name SeaGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name SeaShell.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Sienna.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Silver.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name SkyBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name SlateBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name SlateGray.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Snow.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name SpringGreen.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name SteelBlue.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Tan.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Teal.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Thistle.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Tomato.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Transparent.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Turquoise.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Violet.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Wheat.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name White.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name WhiteSmoke.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name Yellow.
This method will yield the same value for every call because it is immutable.
Yields a new Color for the wellknown name YellowGreen.
This method will yield the same value for every call because it is immutable.
Creates a Color instance from the given color-like object by performing automatic type conversion.
options - Object
A map of options to pass to the method.
- colorLike - Color
The object to convert to a
Color.
- ↪Color
The given
colorLike
if it is already a
Color, or a new instance initialized to the values found in
colorLike
.
Creates a new color instance from ARGB values.
All values must be between 0 and 255.
options - Object
A map of options to pass to the method.
- a - number
The alpha value between 0 and 255.
- r - number
The red value between 0 and 255.
- g - number
The green value between 0 and 255.
- b - number
The blue value between 0 and 255.
- ↪Color
A new color instance with the given values.
Creates a new color instance from HSL and A values.
This works similar to the CSS hsla function.
options - Object
A map of options to pass to the method.
- h - number
The hue value between 0 and 1.
- s - number
The saturation value between 0 and 1.
- l - number
The lightness value between 0 and 1.
- a - number
The alpha value between 0 and 1. 1 if omitted
- ↪Color
A new color instance with the given values.
Creates a new color instance from RGB and A values.
This works similar to the CSS rgba function.
options - Object
A map of options to pass to the method.
- r - number
The red value between 0 and 255.
- g - number
The green value between 0 and 255.
- b - number
The blue value between 0 and 255.
- a - number
The alpha fractional value between 0 and 1. 1 if omitted
- ↪Color
A new color instance with the given values.