You are here

function cheeseburger_hex_to_rgba in Cheeseburger Menu 5.0.x

Converts hex to rgba.

1 call to cheeseburger_hex_to_rgba()
cheeseburger_menu_page_attachments in ./cheeseburger_menu.module
Implements hook_page_attachments().

File

./cheeseburger_menu.module, line 134
Contains cheeseburger_menu.module.

Code

function cheeseburger_hex_to_rgba($hex, $opacity = 1) {
  $hex = str_replace('#', '', $hex);
  return 'rgba( ' . hexdec($hex[0] . $hex[1]) . ', ' . hexdec($hex[2] . $hex[3]) . ', ' . hexdec($hex[4] . $hex[5]) . ', ' . $opacity . ')';
}