Miss any of our Open RFC calls?Watch the recordings here! »

color-curve-adjust

2.0.0 • Public • Published

color-curve-adjust

Build Status Coverage Status

Performs a Photoshop/GIMP curve adjustment on a RGB color

Based on CSPL.js. Read more about the algorithm here.

Install

$ npm install color-curve-adjust

Usage

  • Edit your curve in Photoshop

    Photoshop curve

  • Create an array of each point of the curve

    const curve = [
        { x: 0, y: 85 },
        { x: 50, y: 120 },
        { x: 140, y: 200 },
        { x: 190, y: 225 },
        { x: 255, y: 255 },
    ];
  • Import the module and call it with a color and your array

    const curveAdjust = require('color-curve-adjust');
     
    curveAdjust.rgb('#5a2149', curve);
    //=> '#9d6b8d'
     
    curveAdjust.red('#5a2149', curve);
    //=> '#9d2149'
     
    curveAdjust.green('#5a2149', curve);
    //=> '#5a6b49'
     
    curveAdjust.blue('#5a2149', curve);
    //=> '#5a218d'

License

MIT © Jérôme Zecca

Install

npm i color-curve-adjust

DownloadsWeekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

76.4 kB

Total Files

16

Last publish

Collaborators

  • avatar