The RGB() function
PlayBasic code
[pbcode]
; Make a packed RGB colour value
ThisColour= Rgb(255,45,100)
; Get the level of RED from this packed colour value
R=RGbR(ThisColour)
; Get the level of GREEN from this packed colour value
G=RGbG(ThisColour)
; Get the level of BLUE from this packed colour value
B=RGbB(ThisColour)
ThisColour2= Rgb(R,G,B)
Print Hex$(ThisColour)
Print r
Print g
Print b
Print Hex$(ThisColour2)
[/pbcode]
Also see: PlayBASIC Documentation COLOURS (https://www.playbasic.com/help.php?page=COLOURS.INDEX)