Namespace one.color
UML
one.color
Defined in: color.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
| <private> <static> |
one.color.rgbaRegex
Regex for matching CSS RGBA color strings
|
| Method Attributes | Method Name and Description |
|---|---|
| <private> <static> |
one.color.fromCSSRGBA(strCSS)
Parse a CSS RGBA string.
|
| <private> <static> |
one.color.fromHex(strHex)
Parse a hex string.
|
| <static> |
one.color.installColorSpace(colorSpaceName, propertyDefinitions, config)
|
| <static> |
one.color.parse(obj)
Parse a hex string, 24-bit integer or object representing a color.
|
Field Detail
<private> <static>
one.color.rgbaRegex
Regex for matching CSS RGBA color strings
Defined in: color-parse.js.
Defined in: color-parse.js.
Method Detail
<private> <static>
{one.color.RGB}
one.color.fromCSSRGBA(strCSS)
Parse a CSS RGBA string. Please use one.color#parse instead.
Defined in: color-parse.js.
Defined in: color-parse.js.
- Parameters:
- strCSS
- The CSS RGBA string, e.g. "rgb(100, 255, 100)", "rgba(0, 0, 255, 0.5)", "rgb(0%, 100%, 0%)"....
- Returns:
- {one.color.RGB} Color object representing the parsed color, or false if the string couldn't be parsed.
<private> <static>
{one.color.RGB}
one.color.fromHex(strHex)
Parse a hex string. Please use one.color#parse instead.
Defined in: color-parse.js.
Defined in: color-parse.js.
- Parameters:
- strHex
- The hex string, e.g. "#abc", "123abc"....
- Returns:
- {one.color.RGB} Color object representing the parsed color, or false if the string couldn't be parsed.
<static>
one.color.installColorSpace(colorSpaceName, propertyDefinitions, config)
Defined in: color-installColorSpace.js.
- Parameters:
- colorSpaceName
- propertyDefinitions
- config
<static>
{one.color.RGB|one.color.HSL|one.color.HSV|one.color.CMYK}
one.color.parse(obj)
Parse a hex string, 24-bit integer or object representing a color.
If a one.color.(RGB|HSL|HSV|CMYK) object is provided, it will be returned
as-is, so in library code you can use one.color.parse to be flexible
about how colors are provided to you:
Defined in: color-parse.js.
function foo (color) {
color = color.parse(color);
// Now we are sure that color is a one.color.(RGB|CMYK|HSL|HSV) object, even if it was provided as a hex string.
}
Defined in: color-parse.js.
- Parameters:
- {String|Object} obj
- A hex string, integer value, or object to parse.
- Returns:
- {one.color.RGB|one.color.HSL|one.color.HSV|one.color.CMYK} Color object representing the parsed color, or false if the input couldn't be parsed.