function darkenHexColor(color, amount) {

    var rgb = hexToRgb(color);
    var hsl = rgbToHsl(rgb[0], rgb[1], rgb[2]);
    hsl[2] -= amount;
    rgb = hslToRgb(hsl[0], hsl[1], hsl[2]);
    return rgbToHex(rgb[0], rgb[1], rgb[2]);
}
/**
 * Darken the hex color by amount ,amout is from 0 to 1
 * */
Darken the hex color by amount ,amout is from 0 to 1
Darken the hex color by amount amout is from 0 to 1
function darkenHexColor(color, amount) {
    var rgb = hexToRgb(color);
    var hsl = rgbToHsl(rgb[0], rgb[1], rgb[2]);
    hsl[2] -= amount;
    rgb = hslToRgb(hsl[0], hsl[1], hsl[2]);
    return rgbToHex(rgb[0], rgb[1], rgb[2]);
}
function darkenHexColor ( color , amount ) { var rgb = hexToRgb ( color ) ; var hsl = rgbToHsl ( rgb [ 0 ] , rgb [ 1 ] , rgb [ 2 ] ) ; hsl [ 2 ] -= amount ; rgb = hslToRgb ( hsl [ 0 ] , hsl [ 1 ] , hsl [ 2 ] ) ; return rgbToHex ( rgb [ 0 ] , rgb [ 1 ] , rgb [ 2 ] ) ; }
Darken the hex color by amount ,amout is from 0 to 1
Darken the hex color by amount amout is from 0 to 1