How to use the color-convert.rgb2hsv function in color-convert

To help you get started, we’ve selected a few color-convert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github outmoded / fireworks / lib / index.js View on Github external
internals.fade = function (color, pos, size) {

    var rgb = [(color & (255 << 16)) >> 16, (color & (255 << 8)) >> 8, color & 255];
    var hsv = ColorConvert.rgb2hsv(rgb);
    hsv[2] -= Math.floor(hsv[2] / size * pos);
    rgb = ColorConvert.hsv2rgb(hsv);
    return (rgb[0] << 16) + (rgb[1] << 8) + rgb[2];
};