*/
use Drupal\Component\Utility\Color;
-use Drupal\Component\Utility\Unicode;
use Drupal\Core\Asset\CssOptimizer;
use Drupal\Component\Utility\Bytes;
use Drupal\Component\Utility\Environment;
$memory_limit = ini_get('memory_limit');
$size = Bytes::toInt($memory_limit);
if (!Environment::checkMemoryLimit($usage + $required, $memory_limit)) {
- drupal_set_message(t('There is not enough memory available to PHP to change this theme\'s color scheme. You need at least %size more. Check the <a href="http://php.net/manual/ini.core.php#ini.sect.resource-limits">PHP documentation</a> for more information.', ['%size' => format_size($usage + $required - $size)]), 'error');
+ \Drupal::messenger()->addError(t('There is not enough memory available to PHP to change this theme\'s color scheme. You need at least %size more. Check the <a href="http://php.net/manual/ini.core.php#ini.sect.resource-limits">PHP documentation</a> for more information.', ['%size' => format_size($usage + $required - $size)]));
return;
}
}
// Prepare color conversion table.
$conversion = $palette;
foreach ($conversion as $k => $v) {
- $v = Unicode::strtolower($v);
+ $v = mb_strtolower($v);
$conversion[$k] = Color::normalizeHexLength($v);
}
$default = color_get_palette($theme, TRUE);
// Iterate over all the parts.
foreach ($style as $chunk) {
if ($is_color) {
- $chunk = Unicode::strtolower($chunk);
+ $chunk = mb_strtolower($chunk);
$chunk = Color::normalizeHexLength($chunk);
// Check if this is one of the colors in the default palette.
if ($key = array_search($chunk, $default)) {