SRL Archive - Help

converting simba colour to RGB colour


zluo

2012-07-12 03:09:30

is it possible? I'm just curious because im developing a little something

grats

2012-07-12 03:15:03

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

2012-07-12 03:16:57

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

2012-07-12 03:20:50

It's as simple as:


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

superuser

2012-07-12 04:53:20

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

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. :)


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

2012-07-12 07:35:57

@MasterBB, what does 'shr' do? I have seen it before but don't know what it is for :P

Wizzup?

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


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

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

Chris

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


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: