1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-17 20:10:50 +01:00

Fix inverse invalid color

This commit is contained in:
MatteoPistorello 2023-05-31 17:21:33 +02:00
parent 41f6c4da82
commit b1dec0f818

View File

@ -448,6 +448,7 @@ if (!function_exists('color_inverse')) {
*/
function color_inverse($start_colour)
{
if (preg_match('/^#[a-f0-9]{6}$/i', $start_colour)) { //hex color is valid
$R1 = hexdec(substr($start_colour, 1, 2));
$G1 = hexdec(substr($start_colour, 3, 2));
$B1 = hexdec(substr($start_colour, 5, 2));
@ -466,6 +467,9 @@ if (!function_exists('color_inverse')) {
} else {
return '#000';
}
} else {
return '#000';
}
}
}