mirror of
https://git.code.sf.net/p/seeddms/code
synced 2026-01-20 16:19:16 +00:00
add method getColorBrightness()
This commit is contained in:
parent
0b814df0c6
commit
45b3e55e66
|
|
@ -922,6 +922,14 @@ function getMandatoryApprovers($folder, $user) { /* {{{ */
|
|||
return $approvers;
|
||||
} /* }}} */
|
||||
|
||||
function getColorBrightness($color) { /* {{{ */
|
||||
$red = hexdec(substr($color, 1, 2))/255.0;
|
||||
$green = hexdec(substr($color, 3, 2))/255.0;
|
||||
$blue = hexdec(substr($color, 5, 2))/255.0;
|
||||
$brightness = sqrt(0.299*pow($red, 2) + 0.587*pow($green, 2) + 0.114*pow($blue, 2));
|
||||
return $brightness;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Class for creating encrypted api keys
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user