Skip to content
Snippets Groups Projects
Commit eb01155d authored by Demian Katz's avatar Demian Katz
Browse files

Added support for arbitrary hex colors.

parent 3456e7db
No related merge requests found
...@@ -681,7 +681,8 @@ authors = Wikipedia ...@@ -681,7 +681,8 @@ authors = Wikipedia
; authorFillColor,titleFillColor: the main color used, you can use any of the 16 ; authorFillColor,titleFillColor: the main color used, you can use any of the 16
; named colors from HTML4. ; named colors from HTML4.
; authorBorderColor,titleBorderColor: the color used to make border, you can use ; authorBorderColor,titleBorderColor: the color used to make border, you can use
; any of the 16 named colors from HTML4, or "none" if you don't want any border. ; any of the 16 named colors from HTML4, HTML hex colors (#RRGGBB), or "none" if
; you don't want any border.
; ;
; maxLines: The maximum number of title lines to be displayed (excluding final ; maxLines: The maximum number of title lines to be displayed (excluding final
; ellipses) ; ellipses)
......
...@@ -224,6 +224,12 @@ class Generator ...@@ -224,6 +224,12 @@ class Generator
case 'aqua': case 'aqua':
return imagecolorallocate($this->im, 0, 255, 255); return imagecolorallocate($this->im, 0, 255, 255);
default: default:
if (substr($color, 0, 1) == '#' && strlen($color) == 7) {
$r = hexdec(substr($color, 1, 2));
$g = hexdec(substr($color, 3, 2));
$b = hexdec(substr($color, 5, 2));
return imagecolorallocate($this->im, $r, $g, $b);
}
return false; return false;
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment