November 28, 2020, 01:14:35 PM

Author Topic: [bb] GetRGB by Skully [ 1+ years ago ]  (Read 381 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] GetRGB by Skully [ 1+ years ago ]
« on: June 29, 2017, 12:28:41 AM »
Title : GetRGB
Author : Skully
Posted : 1+ years ago

Description : Returns an RGB colour code for the red/green/blue components and back again

Code :
Code: BlitzBasic
  1. Function GetRed(rgb)
  2.         Return rgb Shr 16 And %11111111
  3. End Function
  4.  
  5. Function GetGreen(rgb)
  6.         Return rgb Shr 8 And %11111111
  7. End Function
  8.  
  9. Function GetBlue(rgb)
  10.         Return rgb And %11111111
  11. End Function
  12.  
  13. Function GetRGB(red,green,blue)
  14.         Return blue Or (green Shl 8) Or (red Shl 16)
  15. End Function


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal