_color_blend

_color_blend($img, $hex1, $hex2, $alpha)

Blends two hex colors and returns the GD color.

File

core/modules/color/color.module, line 739
Allows users to change the color scheme of themes.

Code

function _color_blend($img, $hex1, $hex2, $alpha) {
  $in1 = _color_unpack($hex1);
  $in2 = _color_unpack($hex2);
  $out = array($img);
  for ($i = 0; $i < 3; ++$i) {
    $out[] = $in1[$i] + ($in2[$i] - $in1[$i]) * $alpha;
  }

  return call_user_func_array('imagecolorallocate', $out);
}
doc_Drupal
2016-10-29 09:57:06
Comments
Leave a Comment

Please login to continue.