Integer to RGB

Blitz3D Forums/Blitz3D Programming/Integer to RGB

Naughty Alien(Posted 2007) [#1]
..hey guys, how to convert range 0-16581375 in to R, G, B value?


Naughty Alien(Posted 2007) [#2]
..okay..I got it..thankss...


MadMunky(Posted 2007) [#3]
euhh
...
np ;P


Rob Farley(Posted 2007) [#4]
When you successfully find the answer to something you have asked for on the forum, it's polite to share to solution.

http://www.blitzbasic.com/codearcs/codearcs.php?code=551


Naughty Alien(Posted 2007) [#5]
..thank you for reminding me Rob..


Function RColor%(c%)
Return c Shr 16 And 255 Shl 0
End Function

Function GColor%(c%)
Return c Shr 8 And 255 Shl 0
End Function

Function BColor%(c%)
Return c Shr 0 And 255 Shl 0
End Function


GfK(Posted 2007) [#6]
You don't need Shr 0 or Shl 0.