function ColorTest::testRgbToHex

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/ColorTest.php \Drupal\Tests\Component\Utility\ColorTest::testRgbToHex()
  2. 10 core/tests/Drupal/Tests/Component/Utility/ColorTest.php \Drupal\Tests\Component\Utility\ColorTest::testRgbToHex()
  3. 11.x core/tests/Drupal/Tests/Component/Utility/ColorTest.php \Drupal\Tests\Component\Utility\ColorTest::testRgbToHex()

Tests Color::rgbToHex().

@dataProvider providerTestRbgToHex

Parameters

string $value: The rgb color value.

string $expected: The expected hex color value.

File

core/tests/Drupal/Tests/Component/Utility/ColorTest.php, line 142

Class

ColorTest
Tests Color utility class conversions.

Namespace

Drupal\Tests\Component\Utility

Code

public function testRgbToHex($value, $expected) {
    $this->assertSame($expected, Color::rgbToHex($value));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.