Constructors
constructor
- new Color(red: number, green: number, blue: number, opacity?: number): Color
-
Parameters
-
red: number
-
green: number
-
blue: number
-
Default value opacity: number = 1
Properties
Static ALICEBLUE
ALICEBLUE
: Color = new Color(0.9411765, 0.972549, 1)
Static ANTIQUEWHITE
ANTIQUEWHITE
: Color = new Color(0.9803922, 0.9215686, 0.8431373)
Static AQUA
AQUA
: Color = new Color(0, 1, 1)
Static AQUAMARINE
AQUAMARINE
: Color = new Color(0.4980392, 1, 0.8313726)
Static AZURE
AZURE
: Color = new Color(0.9411765, 1, 1)
Static BEIGE
BEIGE
: Color = new Color(0.9607843, 0.9607843, 0.8627451)
Static BISQUE
BISQUE
: Color = new Color(1, 0.8941177, 0.7686275)
Static BLACK
BLACK
: Color = new Color(0, 0, 0)
Static BLANCHEDALMOND
BLANCHEDALMOND
: Color = new Color(1, 0.9215686, 0.8039216)
Static BLUE
BLUE
: Color = new Color(0, 0, 1)
Static BLUEVIOLET
BLUEVIOLET
: Color = new Color(0.5411765, 0.1686275, 0.8862745)
Static BROWN
BROWN
: Color = new Color(0.6470588, 0.1647059, 0.1647059)
Static BURLYWOOD
BURLYWOOD
: Color = new Color(0.8705882, 0.7215686, 0.5294118)
Static CADETBLUE
CADETBLUE
: Color = new Color(0.372549, 0.6196079, 0.627451)
Static CHARTREUSE
CHARTREUSE
: Color = new Color(0.4980392, 1, 0)
Static CHOCOLATE
CHOCOLATE
: Color = new Color(0.8235294, 0.4117647, 0.1176471)
Static CORAL
CORAL
: Color = new Color(1, 0.4980392, 0.3137255)
Static CORNFLOWERBLUE
CORNFLOWERBLUE
: Color = new Color(0.3921569, 0.5843138, 0.9294118)
Static CORNSILK
CORNSILK
: Color = new Color(1, 0.972549, 0.8627451)
Static CRIMSON
CRIMSON
: Color = new Color(0.8627451, 0.07843138, 0.2352941)
Static CYAN
CYAN
: Color = new Color(0, 1, 1)
Static DARKBLUE
DARKBLUE
: Color = new Color(0, 0, 0.5450981)
Static DARKCYAN
DARKCYAN
: Color = new Color(0, 0.5450981, 0.5450981)
Static DARKGOLDENROD
DARKGOLDENROD
: Color = new Color(0.7215686, 0.5254902, 0.04313726)
Static DARKGRAY
DARKGRAY
: Color = new Color(0.6627451, 0.6627451, 0.6627451)
Static DARKGREEN
DARKGREEN
: Color = new Color(0, 0.3921569, 0)
Static DARKGREY
DARKGREY
: Color = Color.DARKGRAY
Static DARKKHAKI
DARKKHAKI
: Color = new Color(0.7411765, 0.7176471, 0.4196078)
Static DARKMAGENTA
DARKMAGENTA
: Color = new Color(0.5450981, 0, 0.5450981)
Static DARKOLIVEGREEN
DARKOLIVEGREEN
: Color = new Color(0.3333333, 0.4196078, 0.1843137)
Static DARKORANGE
DARKORANGE
: Color = new Color(1, 0.5490196, 0)
Static DARKORCHID
DARKORCHID
: Color = new Color(0.6, 0.1960784, 0.8)
Static DARKRED
DARKRED
: Color = new Color(0.5450981, 0, 0)
Static DARKSALMON
DARKSALMON
: Color = new Color(0.9137255, 0.5882353, 0.4784314)
Static DARKSEAGREEN
DARKSEAGREEN
: Color = new Color(0.5607843, 0.7372549, 0.5607843)
Static DARKSLATEBLUE
DARKSLATEBLUE
: Color = new Color(0.282353, 0.2392157, 0.5450981)
Static DARKSLATEGRAY
DARKSLATEGRAY
: Color = new Color(0.1843137, 0.3098039, 0.3098039)
Static DARKSLATEGREY
DARKSLATEGREY
: Color = Color.DARKSLATEGRAY
Static DARKTURQUOISE
DARKTURQUOISE
: Color = new Color(0, 0.8078431, 0.8196079)
Static DARKVIOLET
DARKVIOLET
: Color = new Color(0.5803922, 0, 0.827451)
Static DEEPPINK
DEEPPINK
: Color = new Color(1, 0.07843138, 0.5764706)
Static DEEPSKYBLUE
DEEPSKYBLUE
: Color = new Color(0, 0.7490196, 1)
Static DIMGRAY
DIMGRAY
: Color = new Color(0.4117647, 0.4117647, 0.4117647)
Static DIMGREY
DIMGREY
: Color = Color.DIMGRAY
Static DODGERBLUE
DODGERBLUE
: Color = new Color(0.1176471, 0.5647059, 1)
Static FIREBRICK
FIREBRICK
: Color = new Color(0.6980392, 0.1333333, 0.1333333)
Static FLORALWHITE
FLORALWHITE
: Color = new Color(1, 0.9803922, 0.9411765)
Static FORESTGREEN
FORESTGREEN
: Color = new Color(0.1333333, 0.5450981, 0.1333333)
Static FUCHSIA
FUCHSIA
: Color = new Color(1, 0, 1)
Static GAINSBORO
GAINSBORO
: Color = new Color(0.8627451, 0.8627451, 0.8627451)
Static GHOSTWHITE
GHOSTWHITE
: Color = new Color(0.972549, 0.972549, 1)
Static GOLD
GOLD
: Color = new Color(1, 0.8431373, 0)
Static GOLDENROD
GOLDENROD
: Color = new Color(0.854902, 0.6470588, 0.1254902)
Static GRAY
GRAY
: Color = new Color(0.5019608, 0.5019608, 0.5019608)
Static GREEN
GREEN
: Color = new Color(0, 0.5019608, 0)
Static GREENYELLOW
GREENYELLOW
: Color = new Color(0.6784314, 1, 0.1843137)
Static GREY
Static HONEYDEW
HONEYDEW
: Color = new Color(0.9411765, 1, 0.9411765)
Static HOTPINK
HOTPINK
: Color = new Color(1, 0.4117647, 0.7058824)
Static INDIANRED
INDIANRED
: Color = new Color(0.8039216, 0.3607843, 0.3607843)
Static INDIGO
INDIGO
: Color = new Color(0.2941177, 0, 0.509804)
Static IVORY
IVORY
: Color = new Color(1, 1, 0.9411765)
Static KHAKI
KHAKI
: Color = new Color(0.9411765, 0.9019608, 0.5490196)
Static LAVENDER
LAVENDER
: Color = new Color(0.9019608, 0.9019608, 0.9803922)
Static LAVENDERBLUSH
LAVENDERBLUSH
: Color = new Color(1, 0.9411765, 0.9607843)
Static LAWNGREEN
LAWNGREEN
: Color = new Color(0.4862745, 0.9882353, 0)
Static LEMONCHIFFON
LEMONCHIFFON
: Color = new Color(1, 0.9803922, 0.8039216)
Static LIGHTBLUE
LIGHTBLUE
: Color = new Color(0.6784314, 0.8470588, 0.9019608)
Static LIGHTCORAL
LIGHTCORAL
: Color = new Color(0.9411765, 0.5019608, 0.5019608)
Static LIGHTCYAN
LIGHTCYAN
: Color = new Color(0.8784314, 1, 1)
Static LIGHTGOLDENRODYELLOW
LIGHTGOLDENRODYELLOW
: Color = new Color(0.9803922, 0.9803922, 0.8235294)
Static LIGHTGRAY
LIGHTGRAY
: Color = new Color(0.827451, 0.827451, 0.827451)
Static LIGHTGREEN
LIGHTGREEN
: Color = new Color(0.5647059, 0.9333333, 0.5647059)
Static LIGHTGREY
LIGHTGREY
: Color = Color.LIGHTGRAY
Static LIGHTPINK
LIGHTPINK
: Color = new Color(1, 0.7137255, 0.7568628)
Static LIGHTSALMON
LIGHTSALMON
: Color = new Color(1, 0.627451, 0.4784314)
Static LIGHTSEAGREEN
LIGHTSEAGREEN
: Color = new Color(0.1254902, 0.6980392, 0.6666667)
Static LIGHTSKYBLUE
LIGHTSKYBLUE
: Color = new Color(0.5294118, 0.8078431, 0.9803922)
Static LIGHTSLATEGRAY
LIGHTSLATEGRAY
: Color = new Color(0.4666667, 0.5333334, 0.6)
Static LIGHTSLATEGREY
LIGHTSLATEGREY
: Color = Color.LIGHTSLATEGRAY
Static LIGHTSTEELBLUE
LIGHTSTEELBLUE
: Color = new Color(0.6901961, 0.7686275, 0.8705882)
Static LIGHTYELLOW
LIGHTYELLOW
: Color = new Color(1, 1, 0.8784314)
Static LIME
LIME
: Color = new Color(0, 1, 0)
Static LIMEGREEN
LIMEGREEN
: Color = new Color(0.1960784, 0.8039216, 0.1960784)
Static LINEN
LINEN
: Color = new Color(0.9803922, 0.9411765, 0.9019608)
Static MAGENTA
MAGENTA
: Color = new Color(1, 0, 1)
Static MAROON
MAROON
: Color = new Color(0.5019608, 0, 0)
Static MEDIUMAQUAMARINE
MEDIUMAQUAMARINE
: Color = new Color(0.4, 0.8039216, 0.6666667)
Static MEDIUMBLUE
MEDIUMBLUE
: Color = new Color(0, 0, 0.8039216)
Static MEDIUMORCHID
MEDIUMORCHID
: Color = new Color(0.7294118, 0.3333333, 0.827451)
Static MEDIUMPURPLE
MEDIUMPURPLE
: Color = new Color(0.5764706, 0.4392157, 0.8588235)
Static MEDIUMSEAGREEN
MEDIUMSEAGREEN
: Color = new Color(0.2352941, 0.7019608, 0.4431373)
Static MEDIUMSLATEBLUE
MEDIUMSLATEBLUE
: Color = new Color(0.4823529, 0.4078431, 0.9333333)
Static MEDIUMSPRINGGREEN
MEDIUMSPRINGGREEN
: Color = new Color(0, 0.9803922, 0.6039216)
Static MEDIUMTURQUOISE
MEDIUMTURQUOISE
: Color = new Color(0.282353, 0.8196079, 0.8)
Static MEDIUMVIOLETRED
MEDIUMVIOLETRED
: Color = new Color(0.7803922, 0.08235294, 0.5215687)
Static MIDNIGHTBLUE
MIDNIGHTBLUE
: Color = new Color(0.09803922, 0.09803922, 0.4392157)
Static MINTCREAM
MINTCREAM
: Color = new Color(0.9607843, 1, 0.9803922)
Static MISTYROSE
MISTYROSE
: Color = new Color(1, 0.8941177, 0.8823529)
Static MOCCASIN
MOCCASIN
: Color = new Color(1, 0.8941177, 0.7098039)
Static NAVAJOWHITE
NAVAJOWHITE
: Color = new Color(1, 0.8705882, 0.6784314)
Static NAVY
NAVY
: Color = new Color(0, 0, 0.5019608)
Static OLDLACE
OLDLACE
: Color = new Color(0.9921569, 0.9607843, 0.9019608)
Static OLIVE
OLIVE
: Color = new Color(0.5019608, 0.5019608, 0)
Static OLIVEDRAB
OLIVEDRAB
: Color = new Color(0.4196078, 0.5568628, 0.1372549)
Static ORANGE
ORANGE
: Color = new Color(1, 0.6470588, 0)
Static ORANGERED
ORANGERED
: Color = new Color(1, 0.2705882, 0)
Static ORCHID
ORCHID
: Color = new Color(0.854902, 0.4392157, 0.8392157)
Static PALEGOLDENROD
PALEGOLDENROD
: Color = new Color(0.9333333, 0.9098039, 0.6666667)
Static PALEGREEN
PALEGREEN
: Color = new Color(0.5960785, 0.9843137, 0.5960785)
Static PALETURQUOISE
PALETURQUOISE
: Color = new Color(0.6862745, 0.9333333, 0.9333333)
Static PALEVIOLETRED
PALEVIOLETRED
: Color = new Color(0.8588235, 0.4392157, 0.5764706)
Static PAPAYAWHIP
PAPAYAWHIP
: Color = new Color(1, 0.9372549, 0.8352941)
Static PEACHPUFF
PEACHPUFF
: Color = new Color(1, 0.854902, 0.7254902)
Static PERU
PERU
: Color = new Color(0.8039216, 0.5215687, 0.2470588)
Static PINK
PINK
: Color = new Color(1, 0.7529412, 0.7960784)
Static PLUM
PLUM
: Color = new Color(0.8666667, 0.627451, 0.8666667)
Static POWDERBLUE
POWDERBLUE
: Color = new Color(0.6901961, 0.8784314, 0.9019608)
Static PURPLE
PURPLE
: Color = new Color(0.5019608, 0, 0.5019608)
Static RED
RED
: Color = new Color(1, 0, 0)
Static ROSYBROWN
ROSYBROWN
: Color = new Color(0.7372549, 0.5607843, 0.5607843)
Static ROYALBLUE
ROYALBLUE
: Color = new Color(0.254902, 0.4117647, 0.8823529)
Static SADDLEBROWN
SADDLEBROWN
: Color = new Color(0.5450981, 0.2705882, 0.07450981)
Static SALMON
SALMON
: Color = new Color(0.9803922, 0.5019608, 0.4470588)
Static SANDYBROWN
SANDYBROWN
: Color = new Color(0.9568627, 0.6431373, 0.3764706)
Static SEAGREEN
SEAGREEN
: Color = new Color(0.1803922, 0.5450981, 0.3411765)
Static SEASHELL
SEASHELL
: Color = new Color(1, 0.9607843, 0.9333333)
Static SIENNA
SIENNA
: Color = new Color(0.627451, 0.3215686, 0.1764706)
Static SILVER
SILVER
: Color = new Color(0.7529412, 0.7529412, 0.7529412)
Static SKYBLUE
SKYBLUE
: Color = new Color(0.5294118, 0.8078431, 0.9215686)
Static SLATEBLUE
SLATEBLUE
: Color = new Color(0.4156863, 0.3529412, 0.8039216)
Static SLATEGRAY
SLATEGRAY
: Color = new Color(0.4392157, 0.5019608, 0.5647059)
Static SLATEGREY
SLATEGREY
: Color = Color.SLATEGRAY
Static SNOW
SNOW
: Color = new Color(1, 0.9803922, 0.9803922)
Static SPRINGGREEN
SPRINGGREEN
: Color = new Color(0, 1, 0.4980392)
Static STEELBLUE
STEELBLUE
: Color = new Color(0.2745098, 0.509804, 0.7058824)
Static TAN
TAN
: Color = new Color(0.8235294, 0.7058824, 0.5490196)
Static TEAL
TEAL
: Color = new Color(0, 0.5019608, 0.5019608)
Static THISTLE
THISTLE
: Color = new Color(0.8470588, 0.7490196, 0.8470588)
Static TOMATO
TOMATO
: Color = new Color(1, 0.3882353, 0.2784314)
Static TRANSPARENT
TRANSPARENT
: Color = new Color(0, 0, 0, 0)
Static TURQUOISE
TURQUOISE
: Color = new Color(0.2509804, 0.8784314, 0.8156863)
Static VIOLET
VIOLET
: Color = new Color(0.9333333, 0.509804, 0.9333333)
Static WHEAT
WHEAT
: Color = new Color(0.9607843, 0.8705882, 0.7019608)
Static WHITE
WHITE
: Color = new Color(1, 1, 1)
Static WHITESMOKE
WHITESMOKE
: Color = new Color(0.9607843, 0.9607843, 0.9607843)
Static YELLOW
YELLOW
: Color = new Color(1, 1, 0)
Static YELLOWGREEN
YELLOWGREEN
: Color = new Color(0.6039216, 0.8039216, 0.1960784)
Methods
brighter
-
darker
-
deriveColor
- deriveColor(hueShift: number, saturationFactor: number, brightnessFactor: number, opacityFactor: number): Color
-
Parameters
-
hueShift: number
-
saturationFactor: number
-
brightnessFactor: number
-
opacityFactor: number
desaturate
-
equals
- equals(obj: Object): boolean
-
Parameters
Returns boolean
getBlue
-
Returns number
getBlueHexString
- getBlueHexString(): string
-
Returns string
getBrightness
-
Returns number
getGreen
-
Returns number
getGreenHexString
- getGreenHexString(): string
-
Returns string
getHSB
-
Returns number[]
getHSBA
-
Returns number[]
getHue
-
Returns number
getOpacity
-
Returns number
getOpacityHexString
- getOpacityHexString(): string
-
Returns string
getRGB
-
Returns number[]
getRGBA
-
Returns number[]
getRed
-
Returns number
getRedHexString
- getRedHexString(): string
-
Returns string
getSaturation
-
Returns number
grayscale
-
hashCode
-
Returns number
interpolate
-
Parameters
invert
-
isOpaque
-
Returns boolean
saturate
-
to0xString
-
Returns string
toCssRgbHexString
- toCssRgbHexString(shorten?: boolean): string
-
Parameters
-
Optional shorten: boolean
Returns string
toCssRgbString
-
Returns string
toCssRgbaHexString
- toCssRgbaHexString(shorten?: boolean): string
-
Parameters
-
Optional shorten: boolean
Returns string
toCssRgbaString
- toCssRgbaString(toCssRgbIfOpaque?: boolean): string
-
Parameters
-
Optional toCssRgbIfOpaque: boolean
Returns string
toCssString
-
Returns string
toRawRgbHexString
- toRawRgbHexString(): string
-
Returns string
toRawRgbaHexString
- toRawRgbaHexString(): string
-
Returns string
toString
-
Returns string
withBlue
- withBlue(blue?: number): Color
-
Parameters
-
Default value blue: number = 1
withBrightness
- withBrightness(brightness?: number): Color
-
Parameters
-
Default value brightness: number = 1
withGreen
- withGreen(green?: number): Color
-
Parameters
-
Default value green: number = 1
withHue
- withHue(hue?: number): Color
-
Parameters
-
Default value hue: number = 0
withOpacity
- withOpacity(opacity?: number): Color
-
Parameters
-
Default value opacity: number = 1
withRed
- withRed(red?: number): Color
-
Parameters
-
Default value red: number = 1
withSaturation
- withSaturation(saturation?: number): Color
-
Parameters
-
Default value saturation: number = 1
Static HSBtoRGB
- HSBtoRGB(hue: number, saturation: number, brightness: number): number[]
-
Parameters
-
hue: number
-
saturation: number
-
brightness: number
Returns number[]
Static RGBtoHSB
- RGBtoHSB(r: number, g: number, b: number): number[]
-
Parameters
-
r: number
-
g: number
-
b: number
Returns number[]
Static color
- color(red: number, green: number, blue: number, opacity?: number): Color
-
Parameters
-
red: number
-
green: number
-
blue: number
-
Default value opacity: number = 1
Static getNamedColor
- getNamedColor(name: string): Color
-
Parameters
Static gray
- gray(gray: number, opacity?: number): Color
-
Parameters
-
gray: number
-
Default value opacity: number = 1
Static grayRgb
- grayRgb(gray: number, opacity?: number): Color
-
Parameters
-
gray: number
-
Default value opacity: number = 1
Static hsb
- hsb(hue: number, saturation: number, brightness: number, opacity?: number): Color
-
Parameters
-
hue: number
-
saturation: number
-
brightness: number
-
Default value opacity: number = 1
Static rgb
- rgb(red: number, green: number, blue: number, opacity?: number): Color
-
Parameters
-
red: number
-
green: number
-
blue: number
-
Default value opacity: number = 1
Static valueOf
- valueOf(value: string): Color
-
Parameters
Static web
- web(colorString: string, opacity?: number): Color
-
Parameters
-
colorString: string
-
Default value opacity: number = 1