function ColorTest::testHexToRgb
Tests Color::hexToRgb().
@dataProvider providerTestHexToRgb
Parameters
string $value: The hex color value.
string $expected: The expected rgb color value.
bool $invalid: Whether this value is invalid and exception should be expected.
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ ColorTest.php, line 83
Class
- ColorTest
- Tests Color utility class conversions.
Namespace
Drupal\Tests\Component\UtilityCode
public function testHexToRgb($value, $expected, $invalid = FALSE) : void {
if ($invalid) {
$this->expectException('InvalidArgumentException');
}
$this->assertSame($expected, Color::hexToRgb($value));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.