Skip to content

Commit dca0549

Browse files
authored
Merge pull request #11 from buggedcom/hex3fix
fixes incorrect parsing of hex3 colours
2 parents 877e2f7 + ce7998c commit dca0549

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Primal/Color/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function hsl () {$this->result = new HSLColor((int)$this->chunks[1], (int)$this
8181
function hsva () {$this->result = new HSVColor((int)$this->chunks[1], (int)$this->chunks[2], (int)$this->chunks[3], (float)$this->chunks[4]);}
8282
function hsv () {$this->result = new HSVColor((int)$this->chunks[1], (int)$this->chunks[2], (int)$this->chunks[3]);}
8383
function hex6 () {$this->result = new RGBColor(hexdec($this->chunks[1]), hexdec($this->chunks[2]), hexdec($this->chunks[3]));}
84-
function hex3 () {$this->result = new RGBColor(hexdec($this->chunks[1])*16, hexdec($this->chunks[2])*16, hexdec($this->chunks[3])*16);}
84+
function hex3 () {$this->result = new RGBColor(hexdec($this->chunks[1].$this->chunks[1]), hexdec($this->chunks[2].$this->chunks[2]), hexdec($this->chunks[3].$this->chunks[3]));}
8585

8686

8787
static $patterns = array(

0 commit comments

Comments
 (0)