X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.class.php;h=be752eedda5fbd7368de4f6d5a08535a2790c3b2;hp=7cc4e19ec506655a4730b2f163540e6b19c70cb3;hb=67f0eb35f6c3fe9bdda3cb585a0fe5e9ccb0e563;hpb=ef48f1930daad7ffc993708ff9e6656135897964
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 7cc4e19..be752ee 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -586,6 +586,10 @@ class PHPFSPOT {
$max_size = 125; // max font size in %
$min_size = 75; // min font size in %
+ // color
+ $max_sat = hexdec('cc');
+ $min_sat = hexdec('44');
+
// get the largest and smallest array values
$max_qty = max(array_values($tags));
$min_qty = min(array_values($tags));
@@ -599,6 +603,7 @@ class PHPFSPOT {
// determine the font-size increment
// this is the increase per tag quantity (times used)
$step = ($max_size - $min_size)/($spread);
+ $step_sat = ($max_sat - $min_sat)/($spread);
// loop through our tag array
foreach ($tags as $key => $value) {
@@ -614,8 +619,14 @@ class PHPFSPOT {
// uncomment if you want sizes in whole %:
$size = ceil($size);
+ $color = $min_sat + ($value - $min_qty) * $step_sat;
+
+ $r = '44';
+ $g = dechex($color);
+ $b = '88';
+
if(isset($this->tags[$key])) {
- $output.= "". $this->tags[$key] .", ";
+ $output.= "". $this->tags[$key] .", ";
}
}