Shawn, I would think that this would be faster. The IIF has to rest the value of the color variable even if it did not need to change it.
code:
function FadeToBlack($c, $)

Dim $B, $G, $R
$B=$c/65536
$G=($c mod 65536)/256
$R=$c-($B*65536)-($G*256)

if $B>$ $B=$ endif
if $G>$ $G=$ endif
if $R>$ $R=$ endif
$FadeToBlack = $B*65536+$G*256+$R

endfunction

_________________________
Home page: http://www.kixhelp.com/hb/