Lines Matching refs:color

4 #	standard color selection dialog.
17 # (2): Implement HSV color selection.
22 # Create a color dialog and let the user choose a color. This function
24 # function when a native color selector widget does not exist
40 # This is the actual number of lines that are drawn in each color strip.
46 # BARS_WIDTH is the number of pixels wide the color bar portion of the
56 # selection rectangle at the bottom of the color bar. No restrictions.
121 # IntensityIncr is the difference in color intensity between a colorbar
153 # Set the initial color, specified by -initialcolor, or the
154 # color chosen by the user the last time.
212 # TopFrame contains the color strips and the color selection
220 set color [string tolower $c]
222 # each f frame contains an [R|G|B] entry and the equiv. color strip.
223 set f [frame $stripsFrame.$color]
229 entry $box.entry -textvariable [format %s $w]($color,intensity) \
239 canvas $f.color -height $height\
243 pack $f.color -expand yes -fill both
248 set data($color,entry) $box.entry
249 set data($color,col) $f.color
250 set data($color,sel) $f.sel
252 bind $data($color,col) <Configure> \
253 "tkColorDialog_DrawColorScale $w $color 1"
254 bind $data($color,col) <Enter> \
255 "tkColorDialog_EnterColorBar $w $color"
256 bind $data($color,col) <Leave> \
257 "tkColorDialog_LeaveColorBar $w $color"
259 bind $data($color,sel) <Enter> \
260 "tkColorDialog_EnterColorBar $w $color"
261 bind $data($color,sel) <Leave> \
262 "tkColorDialog_LeaveColorBar $w $color"
270 # selected color
321 proc tkColorDialog_SetRGBValue {w color} {
324 set data(red,intensity) [lindex $color 0]
325 set data(green,intensity) [lindex $color 1]
326 set data(blue,intensity) [lindex $color 2]
331 foreach color { red green blue } {
332 set x [tkColorDialog_RgbToX $w $data($color,intensity)]
333 tkColorDialog_MoveSelector $w $data($color,sel) $color $x 0
351 proc tkColorDialog_RgbToX {w color} {
354 return [expr ($color * $data(colorbarWidth)/ $data(intensityIncr))]
360 # Draw color scale is called whenever the size of one of the color
367 # col: color bar canvas
419 # Draw the color bars.
426 set color [format "#%02x%02x%02x" \
431 set color [format "#%02x%02x%02x" \
436 set color [format "#%02x%02x%02x" \
446 -fill $color -outline $color]
448 $col itemconf $l -fill $color -outline $color
479 # Combines the intensities of the three colors into the final color
484 set color [format "#%02x%02x%02x" $data(red,intensity) \
487 $data(finalCanvas) conf -bg $color
488 set data(finalColor) $color
489 set data(selection) $color
498 # Only redraws the colors on the color strips that were not manipulated.
499 # Params: color of colorstrip that changed. If color is not [red|green|blue]
537 # Params: sel is the selector canvas window, color is the color of the strip.
539 proc tkColorDialog_StartMove {w sel color x delta {dontMove 0}} {
543 tkColorDialog_MoveSelector $w $sel $color $x $delta
556 proc tkColorDialog_MoveSelector {w sel color x delta} {
566 set diff [expr $x - $data($color,x)]
567 $sel move $data($color,index) $diff 0
568 set data($color,x) [expr $data($color,x) + $diff]
578 # Params: sel is the selector canvas, color is the color of the strip,
581 proc tkColorDialog_ReleaseMouse {w sel color x delta} {
584 set x [tkColorDialog_MoveSelector $w $sel $color $x $delta]
586 # Determine exactly what color we are looking at.
587 set data($color,intensity) [tkColorDialog_XToRgb $w $x]
589 tkColorDialog_RedrawColorBars $w $color
605 foreach color { red green blue } {
606 $data($color,col) conf -width $data(canvasWidth)
607 tkColorDialog_DrawColorScale $w $color 1
619 # Check to make sure that the color is valid
620 if [catch {set color [winfo rgb . $text]} ] {
625 set R [expr [lindex $color 0]/0x100]
626 set G [expr [lindex $color 1]/0x100]
627 set B [expr [lindex $color 2]/0x100]
659 # mouse cursor enters a color bar
661 proc tkColorDialog_EnterColorBar {w color} {
664 $data($color,sel) itemconfig $data($color,index) -fill red
667 # mouse leaves enters a color bar
669 proc tkColorDialog_LeaveColorBar {w color} {
672 $data($color,sel) itemconfig $data($color,index) -fill black