mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Fixing bug with empty string
This commit is contained in:
parent
34642d70c8
commit
15a7456aba
@ -31,6 +31,8 @@ class ChatUtil {
|
||||
*/
|
||||
public static function gradient($string, $start, $end) {
|
||||
$string = self::str_split($string);
|
||||
if (count($string) === 0) return '';
|
||||
|
||||
$r = (int) ((($start >> 16 & 255) - ($end >> 16 & 255)) / (count($string) - 1));
|
||||
$g = (int) ((($start >> 8 & 255) - ($end >> 8 & 255)) / (count($string) - 1));
|
||||
$b = (int) ((($start & 255) - ($end & 255)) / (count($string) - 1));
|
||||
|
Loading…
Reference in New Issue
Block a user