Methods
public alpha(): number
Returns the alpha value of this color (float from 0.0 - 1.0).
Returns
number
public alpha(val: number): JQueryColor
Returns a copy of the color object with the alpha set to val.
Parameters
Returns
JQueryColor
public alpha(val: string): JQueryColor
Returns a copy of the color object with the alpha set to val.
Parameters
Returns
JQueryColor
public blend(othercolor: JQueryColor)
Will apply this color on top of the other color using alpha blending.
Parameters
public blue(): number
Returns the blue component of the color (integer from 0 - 255).
Returns
number
public blue(val: number): JQueryColor
Returns a copy of the color object with the blue set to val.
Parameters
Returns
JQueryColor
public blue(val: string): JQueryColor
Returns a copy of the color object with the blue set to val.
Parameters
Returns
JQueryColor
public green(): number
Returns the green component of the color (integer from 0 - 255).
Returns
number
public green(val: number): JQueryColor
Returns a copy of the color object with the green set to val.
Parameters
Returns
JQueryColor
public green(val: string): JQueryColor
Returns a copy of the color object with the green set to val.
Parameters
Returns
JQueryColor
public hsla(): Array<number>
Returns a HSL tuple [ hue, saturation, lightness, alpha ].
Returns
Array<number>
public hsla(hue: number, saturation: number, lightness: number, alpha?: number): JQueryColor
Returns a copy of the color with any defined values set to the new value.
Parameters
-
hue: number
-
saturation: number
-
lightness: number
-
alpha?: number optional
Returns
JQueryColor
Returns a copy of the color with any defined values set to the new value.
Parameters
Returns
JQueryColor
public hsla(vals: Array<number>): JQueryColor
Returns a copy of the color with any defined values set to the new value.
Parameters
Returns
JQueryColor
public hue(): number
Returns the hue component of the color (integer from 0 - 359).
Returns
number
public hue(val: number): JQueryColor
Returns a copy of the color object with the hue set to val.
Parameters
Returns
JQueryColor
public hue(val: string): JQueryColor
Returns a copy of the color object with the hue set to val.
Parameters
Returns
JQueryColor
public is(otherColor: JQueryColor): boolean
Checks if two colors are equal.
Parameters
Returns
boolean
public lightness(): number
Returns the lightness component of the color (float from 0.0 - 1.0).
Returns
number
public lightness(val: number): JQueryColor
Returns a copy of the color object with the lightness set to val.
Parameters
Returns
JQueryColor
public lightness(val: string): JQueryColor
Returns a copy of the color object with the lightness set to val.
Parameters
Returns
JQueryColor
public red(): number
Returns the red component of the color (integer from 0 - 255).
Returns
number
public red(val: number): JQueryColor
Returns a copy of the color object with the red set to val.
Parameters
Returns
JQueryColor
public red(val: string): JQueryColor
Returns a copy of the color object with the red set to val.
Parameters
Returns
JQueryColor
public rgba(): Array<number>
Returns a rgba "tuple" [ red, green, blue, alpha ].
Returns
Array<number>
public rgba(red: number, green: number, blue: number, alpha?: number): JQueryColor
Returns a copy of the color with any defined values set to the new value.
Parameters
-
red: number
-
green: number
-
blue: number
-
alpha?: number optional
Returns
JQueryColor
Returns a copy of the color with any defined values set to the new value.
Parameters
Returns
JQueryColor
public rgba(vals: Array<number>): JQueryColor
Returns a copy of the color with any defined values set to the new value.
Parameters
Returns
JQueryColor
public saturation(): number
Returns the saturation component of the color (float from 0.0 - 1.0).
Returns
number
public saturation(val: number): JQueryColor
Returns a copy of the color object with the saturation set to val.
Parameters
Returns
JQueryColor
public saturation(val: string): JQueryColor
Returns a copy of the color object with the saturation set to val.
Parameters
Returns
JQueryColor
public toHexString(includeAlpha?: boolean): string
Returns a css string "#abcdef", with "includeAlpha" uses "#rrggbbaa" (alpha *= 255).
Parameters
-
includeAlpha?: boolean optional
Returns
string
public toHslaString(): string
Returns a css string "hsla(330, 75%, 25%, 0.4)".
Returns
string
public toRgbaString(): string
Returns a CSS string "rgba(255, 255, 255, 0.4)".
Returns
string
public transition(othercolor: JQueryColor, distance: number): JQueryColor
The color distance (0.0 - 1.0) of the way between this color and othercolor.
Parameters
Returns
JQueryColor