TGC Codebase Backup



RGB r,g,b functions by Blendman

27th Jun 2014 5:37
Summary

some function to convert RGB() to Red(), Greem(), blue()



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    // RGB -> r,g,b
function Red(color)
    Red = mod(color, 256)
EndFunction red

function blue(color)
    blue = mod((color/256),256)
EndFunction blue

function green(color)
    green = mod((color/(256*256)), 256)
EndFunction green

Function RGB(r,g,b)
    color = r +g*256 + b*256*256
EndFunction color