Dim col As Color 'the color I check
Dim ref As Byte 'the color what I expect
Select Case col.R
Case ref
'code
Case ref - 3 To ref + 3
'code
Case ref - 6 To ref + 6
'code
Case ref - 10 To ref + 10
'code
Case Else
'code
End Select
Ref - X 可以 < 0(错误),或者 ref + X 可以 >255(错误)。
有没有一种快速方法可以避免错误而无需大量 If...then...else?