from int2rgb by Georg D
two functions. one converts an integer to rgb values, the other one converts rgb into an integer.

rgb2int(curR, curG, curB)
function [colorInt] = rgb2int(curR, curG, curB)

colorInt = 256*256*curR + 256*curG + curB;

Contact us