function thb_overlay($value = null, $selector = null) { $overlay_css = ''; $overlay_css .= '.thb-overlay {'; $overlay_css .= 'background: ' . $value . ';'; $overlay_css .= 'background: rgba(' . implode(',', thb_color_hexToRgb($value)) . ', .6);'; $overlay_css .= '}'; return $overlay_css; }
function thb_color_lighten($color, $dif = 20) { if (!thb_text_startsWith($color, "#")) { $color = "#" . $color; } if ($color == "#") { return ""; } $dif = $dif / 100; $colorRgb = thb_color_hexToRgb($color); $colorHsl = thb_color_rgbToHsl($colorRgb); // Lightness $colorHsl[2] += $dif; if ($colorHsl[2] > 1) { $colorHsl[2] = 1; } $colorRgb = thb_color_hslToRgb($colorHsl); return thb_color_rgbToHex($colorRgb); }