Mask ANY colour from a texture

Miscellaneous Forums/Blitz Showcase/Mask ANY colour from a texture

Useful functions, but you could replace

r=(RGB1 And $FF0000)/$10000;separate out the red
g=(RGB1 And $FF00)/$100;green

and

newrgb= a*16777216+r*65536+g*256+b; combine the ARGB back into a number

by

r=(RGB1 And $FF0000)shr 16;separate out the red
g=(RGB1 And $FF00) shr 8;green

and

newrgb= (a shl 24) or (r shl 16) or (g shl 8) or b ; combine the ARGB back into a number

Tho ist's the same, but the second notation is probably more machine friendly. The "/$100" Notation is oftenly used when a Language doesn't offer logical bit-shifting commands. In fact those commands do exist on the CPU Command level.