4 * Class CRM_Utils_ColorTest
7 class CRM_Utils_ColorTest
extends CiviUnitTestCase
{
10 * @dataProvider contrastExamples
12 public function testGetContrast($background, $text) {
13 $this->assertEquals($text, CRM_Utils_Color
::getContrast($background));
16 public function contrastExamples() {
24 ['# 394ba0', 'white'],
25 [' #D54799', 'white'],
30 * @dataProvider rgbExamples
32 public function testGetRgb($hex, $rgb) {
33 $this->assertEquals($rgb, CRM_Utils_Color
::getRgb($hex));
36 public function rgbExamples() {
38 ['#fff', [255, 255, 255]],
39 ['#000000', [0, 0, 0]],
40 ['#111', [17, 17, 17]],
41 [' fffc99 ', [255, 252, 153]],