$hex = str_replace("#", "", $hex); if (strlen($hex) == 3) { $r = hexdec(substr($hex, 0, 1) . substr($hex, 0, 1)); $g = hexdec(substr($hex, 1, 1) . substr($hex, 1, 1)); $b = hexdec(substr($hex, 2, 1) . substr($hex, 2, 1)); } else { $r = hexdec(substr($hex, 0, 2)); $g = hexdec(substr($hex, 2, 2)); $b = hexdec(substr($hex, 4, 2)); } $rgb = array($r, $g, $b); return implode(",", $rgb); // returns the rgb values separated by commas } ob_start(); $parent = getParentColor($color); if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "colors" . DIRECTORY_SEPARATOR . $parent . '.php')) { include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "colors" . DIRECTORY_SEPARATOR . $parent . '.php'; } else { include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "colors" . DIRECTORY_SEPARATOR . 'glass.php'; } $left = 'left'; $right = 'right'; $dir = 'ltr'; $cbfn = ''; if ($rtl == 1) { $left = 'right'; $right = 'left'; $dir = 'rtl'; } if (!empty($_REQUEST['callbackfn'])) {
function updatecolorsprocess() { global $themeSettings; $colors = $_POST['colors']; $_GET['data'] = $_POST['theme']; $parent = getParentColor($_GET['data']); if (!empty($parent)) { if (file_exists(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'colors' . DIRECTORY_SEPARATOR . $parent . '.php')) { include_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'colors' . DIRECTORY_SEPARATOR . $parent . '.php'; } } $themeSettings = setNewColorValue($themeSettings, $_GET['data']); foreach ($themeSettings as $field => $input) { $input = checkcolor($input); if (!empty($colors[strtoupper($input)])) { $themeSettings[$field] = strtoupper($colors[$input]); } } $_SESSION['cometchat']['error'] = 'Color scheme updated successfully'; coloreditor($themeSettings, $_GET['data']); echo 1; }