* Allows users to change the color scheme of themes.
*/
+use Drupal\Component\Utility\Color;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Asset\CssOptimizer;
use Drupal\Component\Utility\Bytes;
// Prepare color conversion table.
$conversion = $palette;
foreach ($conversion as $k => $v) {
- $conversion[$k] = Unicode::strtolower($v);
+ $v = Unicode::strtolower($v);
+ $conversion[$k] = Color::normalizeHexLength($v);
}
$default = color_get_palette($theme, TRUE);
foreach ($style as $chunk) {
if ($is_color) {
$chunk = Unicode::strtolower($chunk);
+ $chunk = Color::normalizeHexLength($chunk);
// Check if this is one of the colors in the default palette.
if ($key = array_search($chunk, $default)) {
$chunk = $conversion[$key];
foreach ($info['slices'] as $file => $coord) {
list($x, $y, $width, $height) = $coord;
$base = drupal_basename($file);
- $image = drupal_realpath($paths['target'] . $base);
+ $image = \Drupal::service('file_system')->realpath($paths['target'] . $base);
// Cut out slice.
if ($file == 'screenshot.png') {