From 6ef1beabd78671359c3c4cd114ac50f6651633f2 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Wed, 8 Jun 2011 00:05:29 +1000 Subject: [PATCH] better random color algorithm --- templates/themes/rrdtool/theme.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/themes/rrdtool/theme.php b/templates/themes/rrdtool/theme.php index c28b5a04..f965fe0e 100644 --- a/templates/themes/rrdtool/theme.php +++ b/templates/themes/rrdtool/theme.php @@ -122,11 +122,12 @@ $c = 0; $cc = 0; + echo PHP_EOL; foreach($this->boards as &$board) { $color = str_pad(dechex($red*85), 2, '0', STR_PAD_LEFT) . str_pad(dechex($green*85), 2, '0', STR_PAD_LEFT) . str_pad(dechex($blue*85), 2, '0', STR_PAD_LEFT); - echo $color . PHP_EOL; + echo $color . ' ' . $c . PHP_EOL; $options[] = 'DEF:posts' . $board . '=' . $settings['path'] . '/' . $board . '.rrd' . ':posts:AVERAGE'; $options[] = 'LINE2:posts' . $board . '#' . $color . ':' . @@ -145,7 +146,7 @@ $red--; $cc++; - if($cc > 3) { + if($cc > 2) { $c++; $cc = 0; }