Color Mod Calc
Calculates the ordered color modifications necessary to transform one color into another one using a very naïve regression model. The transforms can then be applied arbitrarily to any color to achieve the same approximate change in appearance. Definitely room for improvement.
Usage
; { const modifications = await ; console; // [ // [ 'spin', 10.078649177450805 ], // [ 'brighten', -7.317283609750366 ], // [ 'darken', -8.819807201497209 ], // [ 'lighten', 5.4210112063441045 ], // [ 'desaturate', -0.44429180259326095 ], // [ 'saturate', 1.61338436541259 ] // ]}
You can then take the ordered list of operations and apply it to any color using
applyColorMods
; const newColor = ; console;// #658119