You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2014/06/04 12:05:30 UTC

svn commit: r1600079 - in /tcl/rivet/trunk/doc: examples-sgml/color-table.tcl examples/color-table.tcl

Author: mxmanghi
Date: Wed Jun  4 10:05:30 2014
New Revision: 1600079

URL: http://svn.apache.org/r1600079
Log:
further simplification for code in examples/color-table.tcl

Modified:
    tcl/rivet/trunk/doc/examples-sgml/color-table.tcl
    tcl/rivet/trunk/doc/examples/color-table.tcl

Modified: tcl/rivet/trunk/doc/examples-sgml/color-table.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/examples-sgml/color-table.tcl?rev=1600079&r1=1600078&r2=1600079&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/examples-sgml/color-table.tcl (original)
+++ tcl/rivet/trunk/doc/examples-sgml/color-table.tcl Wed Jun  4 10:05:30 2014
@@ -10,9 +10,9 @@ for {set i 0} { $i < 9 } {incr i} {
     puts "<tr>"
     for {set j 0} {$j < 9} {incr j} {
 
-        set r [expr int(255 * ($i + $j) * 32 / 512)] 
-        set g [expr int(255 * (8 - $i + $j) * 32 / 512)]
-        set b [expr int(255 * ($i + 8 - $j) * 32 / 512)]
+        set r [expr int(255 * ($i + $j) / 16)] 
+        set g [expr int(255 * (8 - $i + $j) / 16)]
+        set b [expr int(255 * ($i + 8 - $j) / 16)]
 
 # determining the background luminosity (NTSC) and choosing the foreground
 # color accordingly in order maintain maximum contrast

Modified: tcl/rivet/trunk/doc/examples/color-table.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/examples/color-table.tcl?rev=1600079&r1=1600078&r2=1600079&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/examples/color-table.tcl (original)
+++ tcl/rivet/trunk/doc/examples/color-table.tcl Wed Jun  4 10:05:30 2014
@@ -10,9 +10,9 @@ for {set i 0} { $i < 9 } {incr i} {
     puts "<tr>"
     for {set j 0} {$j < 9} {incr j} {
 
-        set r [expr int(255 * ($i + $j) * 32 / 512)] 
-        set g [expr int(255 * (8 - $i + $j) * 32 / 512)]
-        set b [expr int(255 * ($i + 8 - $j) * 32 / 512)]
+        set r [expr int(255 * ($i + $j) / 16)] 
+        set g [expr int(255 * (8 - $i + $j) / 16)]
+        set b [expr int(255 * ($i + 8 - $j) / 16)]
 
 # determining the background luminosity (NTSC) and choosing the foreground
 # color accordingly in order maintain maximum contrast



---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org