API / geotoolkit / util / ColorUtil / ColorUtil
An utility class that provides helpful functions to manipulate colors. This class provides functions to parse, edit and convert colors from rgba to hsb. It's especially useful to convert colors in css format to toolkit RgbaColor.
Constructors
Methods
Methods
▸ getClassName(): string
string
▸ Static canParseColor(color): boolean
convert true if color can be parsed to RgbaColor
| Name | Type | Description |
|---|---|---|
color | string | color to parse |
boolean
true if color can be parsed
▸ Static colorToString(color): string
converts color to string
string
▸ Static getClassName(): string
string
▸ Static getRandomColorRgb(pseudo?): string
return random RGB color
| Name | Type | Description |
|---|---|---|
Optional pseudo | number | pseudo random |
string
random color
▸ Static getRandomColorRgba(alpha?, pseudo?): string
Returns random RGBA color
| Name | Type | Description |
|---|---|---|
Optional alpha | number | transparency chanel from 0 to 1 |
Optional pseudo | number | pseudo random |
string
random color
▸ Static invertColor(color): string
invert color
| Name | Type | Description |
|---|---|---|
color | string | RgbaColor | color to parse |
string
inverted color
▸ Static parseColor(color): RgbaColor
convert css color {string} to RgbaColor
| Name | Type | Description |
|---|---|---|
color | string | RgbaColor | color to parse |
color
▸ Static parseMSColor(accessCode): RgbaColor
Converts legacy MS Access Code to a RGBA color
See
http://cloford.com/resources/colours/500col.htm
| Name | Type | Description |
|---|---|---|
accessCode | number | The MS access code to convert to a color |
The converted color or null
▸ Static setAlpha(color, a): string
set value for the alpha chanel
| Name | Type | Description |
|---|---|---|
color | string | CSS color |
a | number | alpha component 0 - 255 |
string