1.0.11 • Published 25 days ago
@jexop/color v1.0.11
JSON Expression Color Operators
Basic Usage
import { evaluate, registry } from '@jexop/core';
import { colorOperators } from '@jexop/color';
// register default operators
registry.addDefaults();
// register color operators
registry.add(colorOperators);
Color Operators
color-range
Returns color from a gradient from
-to
Property | Description |
---|---|
from (color) | Color when value is 0 |
to (color) | Color when value is 1 |
value (number) | Normalized number (in range 0-1) |
Examples
{
"op": "color-range",
"from": "red",
"to": "green",
"value": 0.7
}
{
"op": "color-range",
"from": "red",
"to": "green",
"value": {
"op": "normalize",
"min": 0,
"max": 100,
"value": 70
}
}