_color_unpack($hex, $normalize = FALSE)
Converts a hex color into an RGB triplet.
File
- core/modules/color/color.module, line 753
- Allows users to change the color scheme of themes.
Code
1 2 3 4 5 6 7 8 9 10 11 | function _color_unpack( $hex , $normalize = FALSE) { if ( strlen ( $hex ) == 4) { $hex = $hex [1] . $hex [1] . $hex [2] . $hex [2] . $hex [3] . $hex [3]; } $c = hexdec( $hex ); for ( $i = 16; $i >= 0; $i -= 8) { $out [] = (( $c >> $i ) & 0xFF) / ( $normalize ? 255 : 1); } return $out ; } |
Please login to continue.