Colors
The Colors object is is a class containing reusable static methods
Static Method Summary
Static Public Methods | ||
public static |
colorFilter(sBackground: String, iBoundary: Integer, aValues: Array): Boolean Used to filter random colour values and ensure high contrast against background |
|
public static |
convertHexToRgb(sColor: String): Object Converts a HEX string to an RGB value |
|
public static |
getDarkerColor(oColor: Object): Object Returns a darker version of a color |
|
public static |
getRandomColor(sBackground: String, iBoundary: Integer): Object Returns a random color (D3 object) |
|
public static |
getRandomPalette(iLength: Integer): Array Returns a random color palette |
Static Public Methods
public static colorFilter(sBackground: String, iBoundary: Integer, aValues: Array): Boolean source
Used to filter random colour values and ensure high contrast against background
public static convertHexToRgb(sColor: String): Object source
Converts a HEX string to an RGB value
Params:
Name | Type | Attribute | Description |
sColor | String | the HEX colour |
public static getDarkerColor(oColor: Object): Object source
Returns a darker version of a color
Params:
Name | Type | Attribute | Description |
oColor | Object | RGB object |