new D3JSColor(r, g, b)
Parameters:
Name | Type | Description |
---|---|---|
r |
number | |
g |
number | |
b |
number |
Methods
-
<static> FromJSON(jsonObj)
-
Parameters:
Name Type Description jsonObj
Object Returns:
-
<static> getColor(colorId)
-
Parameters:
Name Type Description colorId
number Returns:
-
<static> hslToRgb(h, s, l)
-
Converts an HSL color value to RGB. Conversion formula adapted from http://en.wikipedia.org/wiki/HSL_color_space. Assumes h, s, and l are contained in the set [0, 1] and returns r, g, and b in the set [0, 255].
Parameters:
Name Type Description h
number The hue
s
number The saturation
l
number The lightness
Returns:
The RGB representation
- Type
- Array
-
<static> rgbToHsl(r, g, b)
-
Converts an RGB color value to HSL. Conversion formula adapted from http://en.wikipedia.org/wiki/HSL_color_space. Assumes r, g, and b are contained in the set [0, 255] and returns h, s, and l in the set [0, 1].
Parameters:
Name Type Description r
number The red color value
g
number The green color value
b
number The blue color value
Returns:
The HSL representation
- Type
- Array
-
blend(otherColor, ratio)
-
Parameters:
Name Type Description otherColor
olympe.df.debug.d3.D3JSColor ratio
number 1 means fully this color 0 means fully other color
Returns:
-
getContrastedColor()
-
Returns the same color but with a visible contrast (used for text)
Returns:
-
getDarkerColor(percent)
-
Parameters:
Name Type Description percent
number Returns:
-
toJSON()
-
Returns:
- Type
- Object
-
toRGBAString()
-
Returns:
- Type
- string
-
toRGBString()
-
Returns:
- Type
- string