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 13:18:34 UTC
svn commit: r1600102 - in /tcl/rivet/trunk/doc:
examples-sgml/color-table.tcl examples/color-table.tcl images/color-table.png
Author: mxmanghi
Date: Wed Jun 4 11:18:33 2014
New Revision: 1600102
URL: http://svn.apache.org/r1600102
Log:
improved documentation in color-table.tcl and better contrast in the image
Modified:
tcl/rivet/trunk/doc/examples-sgml/color-table.tcl
tcl/rivet/trunk/doc/examples/color-table.tcl
tcl/rivet/trunk/doc/images/color-table.png
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=1600102&r1=1600101&r2=1600102&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/examples-sgml/color-table.tcl (original)
+++ tcl/rivet/trunk/doc/examples-sgml/color-table.tcl Wed Jun 4 11:18:33 2014
@@ -1,5 +1,5 @@
puts "<html><head>"
-puts "<style>\n td { font-size: 12px; }\n td.bright { color: #ccc; }\n td.dark { color: #222; }\n</style>"
+puts "<style>\n td { font-size: 12px; }\n td.bright { color: #eee; }\n td.dark { color: #222; }\n</style>"
puts "</head><body>"
puts "<table>"
@@ -13,10 +13,10 @@ for {set i 0} { $i < 9 } {incr i} {
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
+# determining the background luminosity (YIQ space of NTSC) and choosing
+# the foreground color accordingly in order maintain maximum contrast
- if { [expr ($r*0.2126)+($g*0.7152)+($b*0.0722)] > 128} {
+ if { [expr ($r*0.29894)+($g*0.58704)+($b*0.11402)] > 128} {
set cssclass "dark"
} else {
set cssclass "bright"
Modified: tcl/rivet/trunk/doc/examples/color-table.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/examples/color-table.tcl?rev=1600102&r1=1600101&r2=1600102&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/examples/color-table.tcl (original)
+++ tcl/rivet/trunk/doc/examples/color-table.tcl Wed Jun 4 11:18:33 2014
@@ -1,5 +1,5 @@
puts "<html><head>"
-puts "<style>\n td { font-size: 12px; }\n td.bright { color: #ccc; }\n td.dark { color: #222; }\n</style>"
+puts "<style>\n td { font-size: 12px; }\n td.bright { color: #eee; }\n td.dark { color: #222; }\n</style>"
puts "</head><body>"
puts "<table>"
@@ -13,10 +13,10 @@ for {set i 0} { $i < 9 } {incr i} {
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
+# determining the background luminosity (YIQ space of NTSC) and choosing
+# the foreground color accordingly in order maintain maximum contrast
- if { [expr ($r*0.2126)+($g*0.7152)+($b*0.0722)] > 128} {
+ if { [expr ($r*0.29894)+($g*0.58704)+($b*0.11402)] > 128} {
set cssclass "dark"
} else {
set cssclass "bright"
Modified: tcl/rivet/trunk/doc/images/color-table.png
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/images/color-table.png?rev=1600102&r1=1600101&r2=1600102&view=diff
==============================================================================
Binary files - no diff available.
---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org