You are here

public function rtf::hex2rgb in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/rtf/rtf_export.inc \rtf::hex2rgb()
  2. 6 class_rtf.php \rtf::hex2rgb()
  3. 7.2 modules/rtf/rtf_export.inc \rtf::hex2rgb()

Convert HEX to RGB (#FFFFFF => r255 g255 b255)

1 call to rtf::hex2rgb()
rtf::addColour in modules/rtf/rtf_export.inc

File

modules/rtf/rtf_export.inc, line 201

Class

rtf

Code

public function hex2rgb($hexcode) {
  $hexcode = str_replace("#", "", $hexcode);
  $rgb = array();
  $rgb["red"] = hexdec(substr($hexcode, 0, 2));
  $rgb["green"] = hexdec(substr($hexcode, 2, 2));
  $rgb["blue"] = hexdec(substr($hexcode, 4, 2));
  $this->colour_rgb = $rgb;
}