Log in

View Full Version : converting simba colour to RGB colour



zluo
07-12-2012, 07:09 AM
is it possible? I'm just curious because im developing a little something

grats
07-12-2012, 07:15 AM
yes, I'm not sure how but it is possible.

http://villavu.com/forum/showthread.php?t=26944

This has RGB it might help you for now

YoHoJo
07-12-2012, 07:16 AM
Yup just use AutoColorAid as linked above and it shows RGB, XYZ, HSL, and 'Simba' color too.
Have a little tutorial about it too, which you probably wont need but hey why not:
http://www.youtube.com/watch?v=98wVrr6GwyU

Brandon
07-12-2012, 07:20 AM
It's as simple as:


var
R, G, B: integer;
begin
ColorToRGB(16777215, R, G, B);
writeln(R);
writeln(G);
writeln(B);
end.

superuser
07-12-2012, 08:53 AM
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. :)

masterBB
07-12-2012, 10:31 AM
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. :)

No the color simba uses is BGR not RGB. The first FF is blue followed by green followed by red.

edit:
Because I want to show off:
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.

Chris
07-12-2012, 11:35 AM
@MasterBB, what does 'shr' do? I have seen it before but don't know what it is for :P

Wizzup?
07-12-2012, 11:53 AM
@MasterBB, what does 'shr' do? I have seen it before but don't know what it is for :P

Shift right. You ought to know with your signature. ;)

https://en.wikipedia.org/wiki/File:Rotate_right_logically.svg

Chris
07-12-2012, 01:48 PM
Shift right. You ought to know with your signature. ;)

https://en.wikipedia.org/wiki/File:Rotate_right_logically.svg

Aah, thanks!
This page explained it a bit better: https://en.wikipedia.org/wiki/Logical_shift :)
That I know how to convert decimal to binary does not mean I have a lot of knowledge about bitwise operations.. although Im still learning :smarty: