arty-charty/util.js
function inerpolateColorsFixedAlpha(col1, col2, amount, alpha) {
  let col1rgb = parseColor(col1);
  let col2rgb = parseColor(col2);
  return RGBobj2string({
    r: Math.min(255, col1rgb.r * amount + col2rgb.r * Math.max(0,1-amount)),
    g: Math.min(255, col1rgb.g * amount + col2rgb.g * Math.max(0,1-amount)),
    b: Math.min(255, col1rgb.b * amount + col2rgb.b * Math.max(0,1-amount)),
    a: alpha
  });
}
function inerpolateColorsFixedAlpha(col1, col2, amount, alpha) {
  let col1rgb = parseColor(col1);
  let col2rgb = parseColor(col2);
  return RGBobj2string({
    r: Math.min(255, col1rgb.r * amount + col2rgb.r * Math.max(0,1-amount)),
    g: Math.min(255, col1rgb.g * amount + col2rgb.g * Math.max(0,1-amount)),
    b: Math.min(255, col1rgb.b * amount + col2rgb.b * Math.max(0,1-amount)),
    a: alpha
  });
}
function inerpolateColorsFixedAlpha ( col1 , col2 , amount , alpha ) { let col1rgb = parseColor ( col1 ) ; let col2rgb = parseColor ( col2 ) ; return RGBobj2string ( { r : Math . min ( 255 , col1rgb . r * amount + col2rgb . r * Math . max ( 0 , 1 - amount ) ) , g : Math . min ( 255 , col1rgb . g * amount + col2rgb . g * Math . max ( 0 , 1 - amount ) ) , b : Math . min ( 255 , col1rgb . b * amount + col2rgb . b * Math . max ( 0 , 1 - amount ) ) , a : alpha } ) ; }
Interpolate two colours and set the alpha value.
Interpolate two colours and set the alpha value .