function shadeColor(col, amount) {
  let col1rgb = parseColor(col);
  return RGBobj2string({
    r: Math.min(255, col1rgb.r * amount + 0 * Math.max(0,1-amount)),
    g: Math.min(255, col1rgb.g * amount + 0 * Math.max(0,1-amount)),
    b: Math.min(255, col1rgb.b * amount + 0 * Math.max(0,1-amount)),
    a: col1rgb.a
  });
}
/**
 * Shade the colour by the given amount.
 */
Shade the colour by the given amount.
Shade the colour by the given amount .
function shadeColor(col, amount) {
  let col1rgb = parseColor(col);
  return RGBobj2string({
    r: Math.min(255, col1rgb.r * amount + 0 * Math.max(0,1-amount)),
    g: Math.min(255, col1rgb.g * amount + 0 * Math.max(0,1-amount)),
    b: Math.min(255, col1rgb.b * amount + 0 * Math.max(0,1-amount)),
    a: col1rgb.a
  });
}
function shadeColor ( col , amount ) { let col1rgb = parseColor ( col ) ; return RGBobj2string ( { r : Math . min ( 255 , col1rgb . r * amount + 0 * Math . max ( 0 , 1 - amount ) ) , g : Math . min ( 255 , col1rgb . g * amount + 0 * Math . max ( 0 , 1 - amount ) ) , b : Math . min ( 255 , col1rgb . b * amount + 0 * Math . max ( 0 , 1 - amount ) ) , a : col1rgb . a } ) ; }
Shade the colour by the given amount.
Shade the colour by the given amount .