X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcolor%2Fcolor.module;fp=web%2Fcore%2Fmodules%2Fcolor%2Fcolor.module;h=b6ffa7c79e80d5498a979f1e49f6f7595c481be0;hp=20d099abcf2cc370ffd263b5eff7a3b0decac8b2;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/color/color.module b/web/core/modules/color/color.module index 20d099abc..b6ffa7c79 100644 --- a/web/core/modules/color/color.module +++ b/web/core/modules/color/color.module @@ -28,7 +28,7 @@ function color_help($route_name, RouteMatchInterface $route_match) { $output .= '
'; $output .= '
' . t('Changing colors') . '
'; $output .= '

' . t('To change the color settings, select the Settings link for your theme on the Appearance page. If the color picker does not appear then the theme is not compatible with the Color module.', [':appearance' => \Drupal::url('system.themes_page')]) . '

'; - $output .= '

' . t('The Color module saves a modified copy of the theme\'s specified stylesheets in the files directory. If you make any manual changes to your theme\'s stylesheet, you must save your color settings again, even if you haven\'t changed the colors. This step is required because the module stylesheets in the files directory need to be recreated to reflect your changes.') . '

'; + $output .= '

' . t("The Color module saves a modified copy of the theme's specified stylesheets in the files directory. If you make any manual changes to your theme's stylesheet, you must save your color settings again, even if you haven't changed the colors. This step is required because the module stylesheets in the files directory need to be recreated to reflect your changes.") . '

'; $output .= '
'; return $output; } @@ -80,7 +80,7 @@ function color_library_info_alter(&$libraries, $extension) { if (isset($libraries[$name]['css'])) { // Override stylesheets. foreach ($libraries[$name]['css'] as $category => $css_assets) { - foreach ($css_assets as $path => $metadata) { + foreach ($css_assets as $path => $metadata) { // Loop over the path array with recolored CSS files to find matching // paths which could replace the non-recolored paths. foreach ($color_paths as $color_path) { @@ -796,9 +796,15 @@ function _color_hsl2rgb($hsl) { */ function _color_hue2rgb($m1, $m2, $h) { $h = ($h < 0) ? $h + 1 : (($h > 1) ? $h - 1 : $h); - if ($h * 6 < 1) return $m1 + ($m2 - $m1) * $h * 6; - if ($h * 2 < 1) return $m2; - if ($h * 3 < 2) return $m1 + ($m2 - $m1) * (0.66666 - $h) * 6; + if ($h * 6 < 1) { + return $m1 + ($m2 - $m1) * $h * 6; + } + if ($h * 2 < 1) { + return $m2; + } + if ($h * 3 < 2) { + return $m1 + ($m2 - $m1) * (0.66666 - $h) * 6; + } return $m1; } @@ -822,9 +828,15 @@ function _color_rgb2hsl($rgb) { $h = 0; if ($delta > 0) { - if ($max == $r && $max != $g) $h += ($g - $b) / $delta; - if ($max == $g && $max != $b) $h += (2 + ($b - $r) / $delta); - if ($max == $b && $max != $r) $h += (4 + ($r - $g) / $delta); + if ($max == $r && $max != $g) { + $h += ($g - $b) / $delta; + } + if ($max == $g && $max != $b) { + $h += (2 + ($b - $r) / $delta); + } + if ($max == $b && $max != $r) { + $h += (4 + ($r - $g) / $delta); + } $h /= 6; }