@jexop/color
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

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
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @jexop/color

Weekly Downloads

7

Version

1.0.11

License

MIT

Unpacked Size

153 kB

Total Files

25

Last publish

Collaborators

  • gregbacchus