zluo
2012-07-12 03:09:30
is it possible? I'm just curious because im developing a little something
2012-07-12 03:09:30
2012-07-12 03:15:03
2012-07-12 03:16:57
2012-07-12 03:20:50
var
R, G, B: integer;
begin
ColorToRGB(16777215, R, G, B);
writeln(R);
writeln(G);
writeln(B);
end.
2012-07-12 04:53:20
2012-07-12 06:31:02
From: superuser
Or if you want to do it manually, paste that number to your calculator and covert it to hex, which is FFFFFF. Separate that to three parts (FF, FF and FF) and you have your RGB. R = FF (255), G = FF and B = FF. :)
program new;
var
colorA: Integer;
begin
colorA := 1420640; // := $15AD60
writeln(colorA);
writeln('red: ' + ToStr(colorA shr 0 and $ff));
writeln('blue: ' + ToStr(colorA shr 8 and $ff));
writeln('green: ' + ToStr(colorA shr 16 and $ff));
end.
2012-07-12 07:35:57
2012-07-12 07:53:30
From: Chris
@MasterBB, what does 'shr' do? I have seen it before but don't know what it is for :P
2012-07-12 09:48:36
From: Wizzup?
Shift right. You ought to know with your signature. ;)
https://en.wikipedia.org/wiki/File:Rotate_right_logically.svg