chartjs-colorful - v1.0.0 / helpers
• Const DebugPlugin: Object
debug console.log plugin.
| Name | Type |
|---|---|
id |
string |
▸ clampColor(linear, min, max, colorMin?, colorMax?): ColorLinear
Get the function is input value [min,max] translate to [colorMin, colorMax] then call linear. ex) linear:(red -> blue), min:0, max:20, colorMin: 1.0, colorMax: 0.0 returned function call by ‘0’ then returned ‘blue’. returned function call by ‘20’ then returned ‘red’.
| Name | Type | Default value |
|---|---|---|
linear |
ColorLinear |
undefined |
min |
number |
undefined |
max |
number |
undefined |
colorMin |
number |
0 |
colorMax |
number |
1 |
▸ clampValue(min, max, rangeMin?, rangeMax?): (value: number) => number
Get the function is input value [min,max] translate to [colorMin, colorMax]. ex) min:0, max:20, colorMin: 1.0, colorMax: 0.0 returned function call by ‘0’ then returned ‘1.0’. returned function call by ‘20’ then returned ‘0.0’.
| Name | Type | Default value |
|---|---|---|
min |
number |
undefined |
max |
number |
undefined |
rangeMin |
number |
0.0 |
rangeMax |
number |
1.0 |
fn
▸ (value): number
| Name | Type |
|---|---|
value |
number |
number
▸ createAlphaConverter(alpha): ColorConverter
Create color’s alpha converter.
| Name | Type |
|---|---|
alpha |
number |
▸ createColors(linear, count, includeOne?): Colors
create Colors from ColorLinear.
includeOne=false(default) => [0, 1].
includeOne=true => [0, 1).
If linear returns the same value for 0 and 1, specify include=false.
For example, linear created with createRotateLinear
| Name | Type | Default value |
|---|---|---|
linear |
ColorLinear |
undefined |
count |
number |
undefined |
includeOne |
undefined | boolean |
true |
▸ createConvertColorBuilder(): ConvertColorBuilder
▸ createLinear(color): ColorLinear
| Name | Type |
|---|---|
color |
string |
▸ createRotateLinear(color, reverse?): ColorLinear
| Name | Type | Default value |
|---|---|---|
color |
string |
undefined |
reverse |
boolean |
false |
▸ createScriptableColor(valueFn, linear): ScriptableColor
| Name | Type |
|---|---|
valueFn |
ScriptableValue |
linear |
ColorLinear |
▸ createScriptableValue(value): ScriptableValue
| Name | Type |
|---|---|
value |
string | ScriptableValue |
▸ getColor(colors, index): string
| Name | Type |
|---|---|
colors |
Colors |
index |
number |
string
▸ getColors(colors, count, startIndex?): Colors
| Name | Type | Default value |
|---|---|---|
colors |
Colors |
undefined |
count |
number |
undefined |
startIndex |
number |
0 |
▸ halfTransparent(color): string
Get a half-transparent color.
#FFFFFF -> #FFFFFF80
| Name | Type |
|---|---|
color |
string |
string
▸ isFunction(v): v is Function
| Name | Type |
|---|---|
v |
any |
v is Function
▸ isNumber(v): v is number
| Name | Type |
|---|---|
v |
any |
v is number
▸ throughNull<V, R>(fn): (v: V | null | undefined) => R | null
v is null then return null. v is NOT null then return fn(v).
| Name |
|---|
V |
R |
| Name | Type |
|---|---|
fn |
(v: V) => R |
fn
▸ (v): R | null
| Name | Type |
|---|---|
v |
V | null | undefined |
R | null
▸ transparent(color): string
Get a transparent color.
#FFFFFF -> #FFFFFF00
| Name | Type |
|---|---|
color |
string |
string