You are here

public function TwigColorTest::providerTestHexToRgbValues in Twig Tools 8

Provides test data for hexToRgbTest.

Return value

array An array of test data with twig values and their hex equivalents.

File

tests/src/Unit/TwigColorTest.php, line 117

Class

TwigColorTest
Tests to ensure color convert filters work correctly.

Namespace

Drupal\Tests\twig_tools\Unit

Code

public function providerTestHexToRgbValues() {
  return [
    [
      "{{ '#ffffff'|hex_to_rgb|join('-') }}",
      '255-255-255',
    ],
    [
      "{{ '#FFFFFF'|hex_to_rgb|join('-') }}",
      '255-255-255',
    ],
    [
      "{{ '#a0c677'|hex_to_rgb|join('-') }}",
      '160-198-119',
    ],
    [
      "{{ '#8e2f2f'|hex_to_rgb|join('-') }}",
      '142-47-47',
    ],
    [
      "{{ '#090a0b'|hex_to_rgb|join('-') }}",
      '9-10-11',
    ],
    [
      "{{ '#636465'|hex_to_rgb|join('-') }}",
      '99-100-101',
    ],
    [
      "{{ '#c7c8c9'|hex_to_rgb|join('-') }}",
      '199-200-201',
    ],
    [
      "{{ '#000000'|hex_to_rgb|join('-') }}",
      '0-0-0',
    ],
    [
      "{{ '#fff'|hex_to_rgb|join('-') }}",
      '255-255-255',
    ],
    [
      "{{ '#FFF'|hex_to_rgb|join('-') }}",
      '255-255-255',
    ],
    [
      "{{ '#zzzzzz'|hex_to_rgb|join('-') }}",
      '',
    ],
    [
      "{{ '#ffffffff'|hex_to_rgb|join('-') }}",
      '',
    ],
  ];
}