Skip to content

Commit

Permalink
fixed issue with negative fade >15 per pixel
Browse files Browse the repository at this point in the history
  • Loading branch information
carwe committed Apr 3, 2011
1 parent 730a030 commit c56bf9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rgb_client.tcl
Expand Up @@ -47,7 +47,7 @@ proc rgb_fillscreen { r g b } {
proc rgb_fadescreenh {r1 g1 b1 r2 g2 b2} {
# fills the screen with rows of colors, fading from one color to the other
for {set i 1} {$i <= $::ydim} {incr i} {
set color [format "%02x%02x%02x" [expr { int( $r1 + ($i * ( ($r2 - $r1) / $::ydim)) ) }] [expr { int( $g1 + ($i * ( ($g2 - $g1) / $::ydim)) ) }] [expr { int( $b1 + ($i * ( ($b2 - $b1) / $::ydim)) ) }]]
set color [format "%02x%02x%02x" [expr { int( $r1 + max( -255,($i * ( ($r2 - $r1) / $::ydim))) ) }] [expr { int( $g1 + max( -255,($i * ( ($g2 - $g1) / $::ydim))) ) }] [expr { int( $b1 + max(-255,($i * ( ($b2 - $b1) / $::ydim)) ) ) }]]
for {set j 1} {$j <= $::xdim} {incr j} {
append frame $color
}
Expand Down

0 comments on commit c56bf9e

Please sign in to comment.