fb:porticula NoPaste
color bit magic for Lachie
Uploader: | Sebastian |
Datum/Zeit: | 29.07.2012 17:51:05 |
Dim black as uinteger = rgb(0,0,0)
Dim red as uinteger = rgb(255,0,0)
print " |alpha_||red___||green_||blue__|"
print "black: " & bin(black, 32)
print "red: " & bin(red, 32)
black = black shr 16
red = red shr 16
print
print "after SHR 16:"
print
print " |alpha_||red___||green_||blue__|"
print "black: " & bin(black, 32)
print "red: " & bin(red, 32)
print
print "and now only the bits which stand for red:"
print
dim as uinteger redpartInBlack, redpartInRed
redpartInBlack = black AND &B11111111
redpartInRed = red AND &B11111111
print " |alpha_||red___||green_||blue__| (hex )"
print "red in black: " & bin(redpartInBlack, 32) & " (&H" & HEX(redpartInBlack,2) & ")"
print "red in red: " & bin(redpartInRed, 32) & " (&H" & HEX(redpartInRed,2) & ")"
print
print "press any key to quit"
sleep