1 #!/usr/local/bin/wish -f
3 # Simple script to change colors of a window.
5 if "$argc < 3" {error "Usage: color appName window option"}
6 set appName [lindex $argv 0]
7 set widget [lindex $argv 1]
8 set option [lindex $argv 2]
13 option add *Scale.sliderForeground "#cdb79e"
14 option add *Scale.activeForeground "#ffe4c4"
15 pack append . [scale .red -command "color red" -label "Red Intensity" \
16 -from 0 -to 255 -orient horizontal -bg "#ffaeb9" -length 250] \
18 pack append . [scale .green -command "color green" -label "Green Intensity" \
19 -from 0 -to 255 -orient horizontal -bg "#43cd80"] {top expand fill}
20 pack append . [scale .blue -command "color blue" -label "Blue Intensity" \
21 -from 0 -to 255 -orient horizontal -bg "#7ec0ee"] {top expand fill}
23 proc color {which intensity} {
24 global red green blue appName widget option
26 send $appName $widget config $option \
27 [format #%02x%02x%02x $red $green $blue]
30 bind . <Control-q> {destroy .}
31 bind . <Control-c> {destroy .}