<?php function toRGB($hex) { $hex = substr($_POST['color'], 1); $hex = str_split($hex); $hex = array_chunk($hex, 2); $newHex = []; foreach ($hex as $sub) { $newHex[] = implode("", $sub); } $color = array_map('hexdec', $newHex); return implode(",", $color); } $myfile = fopen("color.txt", "w") or die; $color = toRGB($_POST['color']); print $color; fwrite($myfile, $color); fclose($myfile);
function yt_lib_lighten($args) { list($color, $delta) = yt_colorArgs($args); $hsl = toHSL($color); $hsl[3] = clamp($hsl[3] + $delta, 100); return toRGB($hsl); }
function indonez_custom_css() { global $smof_data; //General $generalcolor = $smof_data['generalcolor']; $bg_pattern = $smof_data['bg_pattern']; $show_pattern = $smof_data['show_pattern']; $bg_color = $smof_data['bg_color']; $headingcolor = $smof_data['headingcolor']; //Top Section $topareabg = $smof_data['topareabg']; $topareatext = $smof_data['topareatext']; //Menu Section $menuareabg = $smof_data['menuareabg']; $menucolor = $smof_data['menucolor']; $menudesccolor = $smof_data['menudesccolor']; $bgmenucolor = $smof_data['bgmenucolor']; //Footer Section $footerbg = $smof_data['footerbg']; $footertextcolor = $smof_data['footertextcolor']; $footerheadingcolor = $smof_data['footerheadingcolor']; //Custom CSS $custom_css_code = $smof_data['custom_css']; //Font $font = $smof_data['font_body']; $font1 = $smof_data['font_menu']; $font2 = $smof_data['font_menu_desc']; $font3 = $smof_data['font_heading']; //Setting $darkPercent = -5; $darkPercent2 = -15; $lightPercent = 4; $bordermenuarea = colourCreator($menuareabg, $lightPercent); $bgmenucolorhover = colourCreator($menuareabg, $darkPercent); $searchformcolor = colourCreator($menuareabg, $darkPercent2); $bordermenuactive = colourCreator($bgmenucolor, $darkPercent); $footermenuhover = colourCreator($footertextcolor, $lightPercent); $footerline = colourCreator($footerbg, $lightPercent); $buttonhover = colourCreator($generalcolor, $darkPercent); $lightboxhover = toRGB($generalcolor); $custom_css = ''; if ($bg_color != "") { $custom_css .= 'body { background-color:' . $bg_color . ';}' . "\n"; } if ($bg_pattern != "") { $custom_css .= 'body { background-image: url(' . $bg_pattern . ');}' . "\n"; } if ($show_pattern == 0) { $custom_css .= ' body { background-image: none;} ' . "\n"; } $custom_css .= 'body{font-family:' . $font . ', Helvetica, Arial}' . "\n"; $custom_css .= '#mainmenu ul{font-family:' . $font1 . ', Helvetica, Arial}' . "\n"; $custom_css .= 'span.desc-menu, #menu li ul a,#menu li ul a:visited{font-family:' . $font2 . ', Helvetica Neue, Helvetica, Arial, sans-serif}' . "\n"; $custom_css .= 'h1,h2,h3,h4,h5,h6{font-family:' . $font3 . ', Helvetica, Arial}' . "\n"; if ($generalcolor != "") { $custom_css .= '.rdm, button[type="submit"], input[type="submit"], input[type="button"]{background:' . $generalcolor . '}' . "\n"; $custom_css .= '.rdm:hover, button[type="submit"]:hover, input[type="submit"]:hover, input[type="button"]:hover{background:' . $buttonhover . '}' . "\n"; } if ($generalcolor != "") { $custom_css .= 'a:link,a:visited,a:active, .breadcrumb ul li.current_item, .breadcrumb ul li.current_item a, .breadcrumb ul li.current_item a:visited, #pf-filter ul li a:hover, #pf-filter ul li a:active, #pf-filter ul li a.selected, ul.post-info li a:hover, ul.popular-list li p.comment-count a, ul.popular-list li p.comment-count a:visited, ul.popular-list li p.author-name, ul.popular-list li p.author-name a, ul.popular-list li p.author-name a:visited, #error404-left i, .company-name, .list_carousel ul.testi-carousel li .testi-name{color:' . $generalcolor . ';}'; $custom_css .= '.quote-box, .pages a:hover, .pages .current, .wp-pagenavi a:hover, .wp-pagenavi .current, a.comment-reply-link, a.comment-reply-link:visited, form#comment-form #submit, .idz-toggle .ui-accordion-header-active, .idz-accordion .ui-accordion-header-active, .highlight{background:' . $generalcolor . '}'; $custom_css .= '.lightbox-item .lightbox-item-overlay-content, .teaser-gallery-box .lightbox-item .lightbox-item-overlay-content{background:' . $generalcolor . '; background-color:rgba(' . $lightboxhover['R'] . ', ' . $lightboxhover['G'] . ', ' . $lightboxhover['B'] . ', 0.8); }'; $custom_css .= '.teaser-preview-box, #map, .google_map, .pages a:hover, .pages .current, .wp-pagenavi a:hover, .wp-pagenavi .current, .idz-toggle .ui-accordion-header-active, .idz-accordion .ui-accordion-header-active{border-color:' . $generalcolor . ' !important}' . "\n"; $custom_css .= '.idz-tabs .idz-nav .ui-tabs-selected a, .idz-tabs .idz-nav .ui-tabs-active a {border-top:solid 1px ' . $generalcolor . '; color:' . $generalcolor . ';}' . "\n"; $custom_css .= '.idz-tabs.bottom .idz-nav .ui-tabs-selected a, .idz-tabs.bottom .idz-nav .ui-tabs-active a {border-bottom:solid 1px ' . $generalcolor . ' !important; color:' . $generalcolor . ';}' . "\n"; $custom_css .= '.idz-tabs.left .idz-nav .ui-tabs-selected a, .idz-tabs.left .idz-nav .ui-tabs-active a{border-left:solid 1px ' . $generalcolor . ' !important; color:' . $generalcolor . ';}' . "\n"; $custom_css .= '.idz-tabs.right .idz-nav .ui-tabs-selected a, .idz-tabs.right .idz-nav .ui-tabs-active a{border-right:solid 1px ' . $generalcolor . ' !important; color:' . $generalcolor . ';}' . "\n"; $custom_css .= '.mborder{background:' . $generalcolor . ';}' . "\n"; } $custom_css .= 'h1,h2,h3,h4,h5,h6{color:' . $headingcolor . '}' . "\n"; $custom_css .= 'header#top{background:' . $topareabg . '}' . "\n"; $custom_css .= '#top-info, #top-info span, #top-info a, #top-info a:visited{color:' . $topareatext . '}' . "\n"; $custom_css .= '#mainmenu-wrapper, #menu ul{background:' . $menuareabg . '}' . "\n"; $custom_css .= '#top-search input[type="text"], a.trigger{color:#5f7387}' . "\n"; if ($menuareabg != "") { $custom_css .= '#mainmenu ul li{border-color:' . $bordermenuarea . '}' . "\n"; $custom_css .= 'a.trigger, a.active.trigger, #top-search #searchform{background:' . $searchformcolor . '}' . "\n"; $custom_css .= '#top-search input[type="text"], a.trigger{color:#ccc}' . "\n"; } if ($menudesccolor != "") { $custom_css .= 'span.desc-menu{color:' . $menudesccolor . '}' . "\n"; } $custom_css .= '#mainmenu ul li a, #mainmenu ul li li a:hover, #mainmenu ul li li:hover > a #mainmenu ul li li.current_page_item > a, #mainmenu ul li li.current_page_item:hover > a, #mainmenu ul li li.current_page_parent > a, #mainmenu ul li li.current_page_parent:hover > a, #mainmenu ul li li.current-menu-parent > a, #mainmenu ul li li.current-menu-parent:hover > a, #mainmenu ul li li.current-menu-item > a, #mainmenu ul li li.current-menu-ancestor > a{color:' . $menucolor . '}' . "\n"; if ($menuareabg != "") { $custom_css .= '#mainmenu ul li:hover, #mainmenu ul li li:hover, #mainmenu li.current_page_item, #mainmenu li.current_page_parent, #mainmenu li.current-menu-parent, #mainmenu li.current-menu-item{background:' . $bgmenucolorhover . '}' . "\n"; } if ($bgmenucolor != "") { $custom_css .= '#mainmenu ul li:hover, #mainmenu li.current_page_item, #mainmenu li.current_page_parent, #mainmenu li.current-menu-parent, #mainmenu li.current-menu-item{border-color:' . $bordermenuactive . '}' . "\n"; } if ($footerbg != "") { $custom_css .= 'footer{background:' . $footerbg . '}' . "\n"; $custom_css .= 'ul.footer-address{border-color:' . $footerline . '}' . "\n"; } $custom_css .= 'footer ul li a, footer ul li a:visited, footer ul li, footer ul li:after, footer ul li:before, footer p, .textwidget, #wp-calendar th, #wp-calendar caption{color:' . $footertextcolor . ' !important}' . "\n"; if ($footertextcolor != "") { $custom_css .= 'footer ul li a:hover{color:' . $footermenuhover . ' !important}' . "\n"; } $custom_css .= 'footer h1, footer h2, footer h3, footer h4, footer h5, footer h6{color:' . $footerheadingcolor . '}' . "\n"; if ($custom_css_code != "") { $custom_css .= $custom_css_code . "\n"; } $css_output = "<!-- Custom CSS -->\n<style type=\"text/css\">\n" . $custom_css . "\n</style>"; if (!empty($custom_css)) { echo $css_output; } }