next up previous contents index
Next: 11.3.5 debug Up: 11.3 Core Text Commands Previous: 11.3.3 color

11.3.4 colorinfo

      (Tcl) This command provides access to the color definitions. For information on the color properties see the chapter on Coloring.

Examples:

  # find out what color corresponds to which id:
  set i 0
  foreach color [colorinfo colors] {
    puts "$i $color"
    incr i
  }


  # also get a list of RGB values
  set i 0
  foreach color [colorinfo colors] {
    lassign [colorinfo rgb $color] r g b
    puts "$i $color   \{$r $g $b\}"
    incr i
  }

 


Sergei Izrailev
Fri Jul 25 17:07:27 CDT 1997