diff --git a/core/includes/form.inc b/core/includes/form.inc index 859c0ce5027a6b0200f95590de11253ad84e910f..f76988b4b2d2a135273ead1febd0b320bfc5b613 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -5,6 +5,7 @@ * Functions for form and batch generation and processing. */ +use Drupal\Component\Utility\Color; use Drupal\Component\Utility\NestedArray; use Drupal\Component\Utility\Number; use Drupal\Component\Utility\SafeMarkup; @@ -16,7 +17,6 @@ use Drupal\Core\Form\OptGroup; use Drupal\Core\Render\Element; use Drupal\Core\Template\Attribute; -use Drupal\Core\Utility\Color; use Symfony\Component\HttpFoundation\RedirectResponse; /** diff --git a/core/lib/Drupal/Core/Utility/Color.php b/core/lib/Drupal/Component/Utility/Color.php similarity index 91% rename from core/lib/Drupal/Core/Utility/Color.php rename to core/lib/Drupal/Component/Utility/Color.php index 5f6bddc4f2324e7353eda5f5556627a07c9393e1..4b09a282225d2a11872c23b426bf99ec3f318313 100644 --- a/core/lib/Drupal/Core/Utility/Color.php +++ b/core/lib/Drupal/Component/Utility/Color.php @@ -2,12 +2,10 @@ /** * @file - * Definition of Drupal\Core\Utility\Color. + * Definition of Drupal\Component\Utility\Color. */ -namespace Drupal\Core\Utility; - -use Drupal\Component\Utility\Unicode; +namespace Drupal\Component\Utility; /** * Performs color conversions. @@ -15,7 +13,7 @@ class Color { /** - * Validates whether a hexadecimal color value is syntatically correct. + * Validates whether a hexadecimal color value is syntactically correct. * * @param $hex * The hexadecimal string to validate. May contain a leading '#'. May use @@ -56,7 +54,7 @@ public static function hexToRgb($hex) { // Ignore '#' prefixes. $hex = ltrim($hex, '#'); - // Convert shorhands like '#abc' to '#aabbcc'. + // Convert shorthands like '#abc' to '#aabbcc'. if (strlen($hex) == 3) { $hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2]; } diff --git a/core/modules/image/src/Plugin/ImageEffect/RotateImageEffect.php b/core/modules/image/src/Plugin/ImageEffect/RotateImageEffect.php index e0cb8de7d05f1806bd1843d4e55159622e7449b7..078dbf6e993f9fc9078be17d58a60ce60a2ef039 100644 --- a/core/modules/image/src/Plugin/ImageEffect/RotateImageEffect.php +++ b/core/modules/image/src/Plugin/ImageEffect/RotateImageEffect.php @@ -7,9 +7,9 @@ namespace Drupal\image\Plugin\ImageEffect; +use Drupal\Component\Utility\Color; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Image\ImageInterface; -use Drupal\Core\Utility\Color; use Drupal\image\ConfigurableImageEffectBase; /** diff --git a/core/tests/Drupal/Tests/Core/Utility/ColorTest.php b/core/tests/Drupal/Tests/Component/Utility/ColorTest.php similarity index 96% rename from core/tests/Drupal/Tests/Core/Utility/ColorTest.php rename to core/tests/Drupal/Tests/Component/Utility/ColorTest.php index e54d445ab8770cef8cb12d36209cd9fb9951c8cb..a8d90312045f7cd6e187c98c467781b11c289166 100644 --- a/core/tests/Drupal/Tests/Core/Utility/ColorTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/ColorTest.php @@ -2,12 +2,12 @@ /** * @file - * Contains \Drupal\Tests\Core\Utility\ColorTest. + * Contains \Drupal\Tests\Component\Utility\ColorTest. */ -namespace Drupal\Tests\Core\Utility; +namespace Drupal\Tests\Component\Utility; -use Drupal\Core\Utility\Color; +use Drupal\Component\Utility\Color; use Drupal\Tests\UnitTestCase; /**