function _color_pack in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/color/color.module \_color_pack()
Converts an RGB triplet to a hex color.
1 call to _color_pack()
- _color_shift in core/
modules/ color/ color.module - Shifts a given color, using a reference pair and a target blend color.
File
- core/
modules/ color/ color.module, line 767 - Allows users to change the color scheme of themes.
Code
function _color_pack($rgb, $normalize = FALSE) {
$out = 0;
foreach ($rgb as $k => $v) {
$out |= $v * ($normalize ? 255 : 1) << 16 - $k * 8;
}
return '#' . str_pad(dechex($out), 6, 0, STR_PAD_LEFT);
}