function input_color($options, $id) { echo ' <div class="colorpicker-box-container"> <div class="colorpicker-box-transparency"></div> <div class="colorpicker-box" style="background-color:' . headway_format_color($options['value']) . ';"></div> </div><!-- .colorpicker-box-container --> '; }
public static function complex_property_shadow($args) { extract($args); $shadow_type = strpos($property_id, 'box-shadow') !== false ? 'box-shadow' : 'text-shadow'; global $headway_complex_property_check; //If the complex property check isn't even set, make it an empty array. if (!is_array($headway_complex_property_check)) { $headway_complex_property_check = array($shadow_type => array()); } //Since the complex property is a combination of a bunch of properties, we only want it to output once. if (isset($headway_complex_property_check[$shadow_type][$selector]) && $headway_complex_property_check[$shadow_type][$selector] == true) { return; } $headway_complex_property_check[$shadow_type][$selector] = true; if (!isset($properties[$shadow_type . '-color'])) { return null; } $shadow_color = headway_format_color($properties[$shadow_type . '-color']); if ($shadow_color == 'transparent') { return null; } $shadow_hoffset = isset($properties[$shadow_type . '-horizontal-offset']) ? $properties[$shadow_type . '-horizontal-offset'] : '0'; $shadow_voffset = isset($properties[$shadow_type . '-vertical-offset']) ? $properties[$shadow_type . '-vertical-offset'] : '0'; $shadow_blur = isset($properties[$shadow_type . '-blur']) ? $properties[$shadow_type . '-blur'] : '0'; $shadow_inset = headway_get($shadow_type . '-position', $properties, 'outside') == 'inset' ? ' inset' : null; return $shadow_type . ': ' . $shadow_color . ' ' . $shadow_hoffset . 'px ' . $shadow_voffset . 'px ' . $shadow_blur . 'px' . $shadow_inset . ';'; }
public function input_colorpicker($input) { $input['value'] = headway_format_color($input['value']); echo ' <div class="input-left"> <label>' . $input['label'] . '</label> </div> <div class="input-right"> <div class="colorpicker-box-container"> <div class="colorpicker-box-transparency"></div> <div class="colorpicker-box" style="background-color:' . $input['value'] . ';"></div> </div><!-- .colorpicker-box-container --> <input ' . $input['attributes'] . ' type="hidden" value="' . $input['value'] . '" /> </div> '; }