dim tst as color = surf.Pixel( nx, ny)
if (tst.red + tst.green + tst.blue ) < 80 then //arbitrary value.. experiment with the threshold?
//its dark
end if
Function isBetween(compareColor as Color, firstColor as Color, secondColor as Color) as Boolean
If compareColor.Red < min(firstColor.Red, secondColor.Red) or compareColor.Red > max(firstColor.Red, secondColor.Red) then
Return False
End If
If compareColor.Green < min(firstColor.Green, secondColor.Green) or compareColor.Green > max(firstColor.Green, secondColor.Green) then
Return False
End If
If compareColor.Blue < min(firstColor.Blue, secondColor.Blue) or compareColor.Blue > max(firstColor.Blue, secondColor.Blue) then
Return False
End If
Return True
End Function