[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    www/sites/accessibility
From:       Olaf Schmidt <ojschmidt () kde ! org>
Date:       2007-07-06 16:38:29
Message-ID: 1183739909.225502.20579.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 684439 by ojschmidt:

second tint function test9

 M  +7 -6      oxygen.php  


--- trunk/www/sites/accessibility/oxygen.php #684438:684439
@@ -192,7 +192,7 @@
         return toRGBHex ($tp, $tn, $to);
 }
 
-function tint1 (const $basecolor, const $tintcolor, $amount) {
+function tint1 (const $basecolor, const $tintcolor, $amount, &$luminosity) {
     // ported from Matthew's implementation in kdelibs
     $newcolor = array ();
     $newcolor ["red256"] = round ($basecolor ["red256"] + pow ($amount, 0.5) * \
($tintcolor ["red256"] - $basecolor ["red256"])); @@ -203,7 +203,7 @@
     return toRGB ($newcolor ["hue"], $newcolor ["saturation"], $luminosity);
 }
 
-function tint2 (const $basecolor, const $tintcolor, $amount) {
+function tint2 (const $basecolor, const $tintcolor, $amount, &$luminosity) {
     $luminosity = $basecolor ["luminosity"];
     if ($luminosity < 0.05)  $luminosity = $tintcolor ["luminosity"] < 0.07 ? \
                $tintcolor ["luminosity"] : 0.07;
     if ($luminosity > 0.70)  $luminosity = $tintcolor ["luminosity"] > 0.65 ? \
$tintcolor ["luminosity"] : 0.65; @@ -255,21 +255,22 @@
         echo '</div>';
         echo '<div>';
         echo 'Tint1: ';
+        $luminosity = 0;
         for ($amount = 0; $amount <= 10; $amount++) {
-            echo '<span style="background-color:'.tint1 ($extracolor, $color, \
$amount/10).';color:'; +            echo '<span style="background-color:'.tint1 \
                ($extracolor, $color, $amount/10, $luminosity).';color:';
             echo ($extracolor ["luminosity"] < 0.5) ? "#FFFFFF" : "#000000";
             echo '">';
-            printf ('%.1f ', $amount/10);
+            printf ('%.1f ', $luminosity);
             echo '</span>';
         }
         echo '</div>';
         echo '<div>';
         echo 'Tint2: ';
         for ($amount = 0; $amount <= 10; $amount++) {
-            echo '<span style="background-color:'.tint2 ($extracolor, $color, \
$amount/10).';color:'; +            echo '<span style="background-color:'.tint2 \
                ($extracolor, $color, $amount/10, $luminosity).';color:';
             echo ($extracolor ["luminosity"] < 0.5) ? "#FFFFFF" : "#000000";
             echo '">';
-            printf ('%.1f ', $amount/10);
+            printf ('%.1f ', $luminosity);
             echo '</span>';
         }
         echo '</div>';


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic