public function test_rgba2hex()
{
/**
* White
*/
$this->assertEquals('#ffffff', Kirki_Color::rgba2hex('rgba(255,255,255,1)'));
$this->assertEquals('#ffffff', Kirki_Color::rgba2hex('rgba(255,255,255,0)'));
$this->assertEquals('#ffffff', Kirki_Color::rgba2hex('rgba( 255, 255, 255, 0 ) '));
$this->assertEquals(true, '#ffffff' != Kirki_Color::rgba2hex('rgba(255,230,255,1)'));
/**
* Black
*/
$this->assertEquals('#000000', Kirki_Color::rgba2hex('rgba(0,0,0,1)'));
$this->assertEquals('#000000', Kirki_Color::rgba2hex('rgba( 0, 0, 0, 1)'));
$this->assertEquals(true, '#000000' != Kirki_Color::rgba2hex('rgba(0,0,0,.1)'));
/**
* Opacity
*/
$this->assertEquals('#7f7f7f', Kirki_Color::rgba2hex('rgba(0,0,0,.5)'));
$this->assertEquals('#ff7f7f', Kirki_Color::rgba2hex('rgba(255,0,0,.5)'));
$this->assertEquals('#7fff7f', Kirki_Color::rgba2hex('rgba(0,255,0,.5)'));
$this->assertEquals('#7f7fff', Kirki_Color::rgba2hex('rgba(0,0,255,.5)'));
/**
* invalid
*/
$this->assertEquals('#ffffff', Kirki_Color::rgba2hex('rgba(0,.5)'));
$this->assertEquals('#ffffff', Kirki_Color::rgba2hex('#ffffff'));
}