This namespace contains functions that pertain to manipulating colors.
Methods
-
alk.color.shadeColor(color, shade){ol.Color}
-
This function takes a color and returns a new
ol.Color
that shades the color according to the shade parameter, which is between -1 and 1.Name Type Description color
ol.Color | ol.ColorLike The color to shade
shade
number A number between -1 and 1;
Returns:
This method returns a new color structure.
Example
console.log(JSON.stringify(alk.color.shadeColor([128,20,100],-1))); console.log(JSON.stringify(alk.color.shadeColor([128,20,100],-0.5))); console.log(JSON.stringify(alk.color.shadeColor([128,20,100],0.0))); console.log(JSON.stringify(alk.color.shadeColor([128,20,100],0.5))); console.log(JSON.stringify(alk.color.shadeColor([128,20,100],1))); [0,0,0] [64,10,50] [128,20,100] [192,138,178] [255,255,255]