RGB(r, g, b) creates a long value that represents a color. color attribute. RGB(r, g, b) is r + 256# * g + 256# * 256# * b. sub rgb_components(rgb_ as long, byRef r as long, byRef g as long, byRef b as long)
r = rgb_ mod 256
g = rgb_ \ 256 mod 256
b = rgb_ \ 65536 mod 256
end sub
sub test_func
dim r as long
dim g as long
dim b as long
rgb_components rgb(200, 220, 250), r, g, b
debug.print "r = " & r & ", g = " & g & ", b = " & b
end sub
vbRed, vbGreen or vbBlue. rgb.