From ac3dfbde0e19e106af1eb50b2bfbb6ed62fc00ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 10 Dec 2011 14:45:14 +0100 Subject: [PATCH] Revert "Slight rewrite of ChatUtil::gradient()" This reverts commit 7b07072a8e037cba571423e83becd97fe0757fb3. Conflicts: file/lib/util/ChatUtil.class.php --- file/lib/util/ChatUtil.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/file/lib/util/ChatUtil.class.php b/file/lib/util/ChatUtil.class.php index fb758dd..7543a78 100644 --- a/file/lib/util/ChatUtil.class.php +++ b/file/lib/util/ChatUtil.class.php @@ -31,13 +31,13 @@ class ChatUtil { */ public static function gradient($string, $start, $end) { $string = str_split($string); - $r = (int) ((($start & 0xFF0000) - ($end & 0xFF0000)) / (count($string) - 1)); - $g = (int) ((($start & 0x00FF00) - ($end & 0x00FF00)) / (count($string) - 1)); - $b = (int) ((($start & 0x0000FF) - ($end & 0x0000FF)) / (count($string) - 1)); + $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)); $result = ''; for ($i = 0, $max = count($string); $i < $max; $i++) { - $result .= ''.$string[$i].''; + $result .= ''.$string[$i].''; } return $result;