Skip to content

Commit

Permalink
Patch RGB to Hex bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksagona committed Sep 20, 2023
1 parent 143f29e commit 9afcff2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Color/Rgb.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function toHsl()
*/
public function toHex()
{
$hex = dechex($this->r) . dechex($this->g) . dechex($this->b);
$hex = str_pad(dechex($this->r), 2, '0', STR_PAD_LEFT) . str_pad(dechex($this->g), 2, '0', STR_PAD_LEFT) . str_pad(dechex($this->b), 2, '0', STR_PAD_LEFT);
return new Hex($hex);
}

Expand Down

0 comments on commit 9afcff2

Please sign in to comment.