name22

RGB Compare with Tolerance

Apr 22nd, 2012
83
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $iARGB_1 = 0x050505
  2. $iARGB_2 = 0x00050A
  3.  
  4. If BinaryMid($iARGB_1, 1, 1) <= Number(BinaryMid($iARGB_2, 1, 1)) + 5 And BinaryMid($iARGB_1, 1, 1) >= Number(BinaryMid($iARGB_2, 1, 1)) - 5 And _
  5.    BinaryMid($iARGB_1, 2, 1) <= Number(BinaryMid($iARGB_2, 2, 1)) + 5 And BinaryMid($iARGB_1, 2, 1) >= Number(BinaryMid($iARGB_2, 2, 1)) - 5 And _
  6.    BinaryMid($iARGB_1, 3, 1) <= Number(BinaryMid($iARGB_2, 3, 1)) + 5 And BinaryMid($iARGB_1, 3, 1) >= Number(BinaryMid($iARGB_2, 3, 1)) - 5 Then _
  7.    MsgBox(0,"",True)
RAW Paste Data