Skip to content
Snippets Groups Projects
Commit a7364b37 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2324113 by penyaskito: Move Drupal/Core/Utility/Color to Drupal/Component/Utility/Color.

parent a704796c
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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;
/**
......
......@@ -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];
}
......
......@@ -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;
/**
......
......@@ -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;
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment