SRL Archive - General

RGB to SCAR Colour? How?


noidea

2009-11-14 01:28:17

Ok, I was looking at this http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Color.html and I was like ._.

How does SCAR calculate the RGB values of a 'colour' and then turn it into an integer?

Thanks :)

Boreas

2009-11-14 01:33:47

(R+256*G)*256+B or maybe the other way around

Boreas

2009-11-14 01:36:08

Actually (B+256*G)*256+R

noidea

2009-11-14 01:54:20

Thanks Boreas!

YoHoJo

2009-11-14 02:01:20

Double post Boreas! I aughta infract you!

nielsie95

2009-11-14 03:16:35


program New;
const
r = 100;
g = 100;
b = 100;
begin
WriteLn( RGBtoColor(r, g, b) );
WriteLn( (r + (g shl 8) + (b shl 16)) );
end.


program New;
const
c = 13132900;
var
r, g, b: Integer;
begin
ColorToRGB(c, r, g, b);
WriteLn(Format('r: %d g: %d b: %d', [r, g, b]));
r := Byte(c);
g := Byte(c shr 8);
b := Byte(c shr 16);
WriteLn(Format('r: %d g: %d b: %d', [r, g, b]));
end.

noidea

2009-11-14 17:10:01

Thanks nielsie! Helped A LOT

maxcreigs

2010-02-24 06:52:07

Thanks,

I will give this a build this week and let you know =)

I think I have the most fussiest of Plasma RGB in TV sets… I have tried so many different methods of configuring SCART for the Amiga output it is crazt, what really peeves me is that it would work fine on the CRT tv, just not my plasma!!!

So it would be nice to be able to put this to bed to be honest!

Cazax

2010-02-24 09:33:20

http://villavu.com/forum/showthread.php?t=18514
Every formula has its explanation :)

Smartzkid

2010-02-24 13:23:04

Except for the DTM formula..

nielsie95

2010-02-24 13:24:15

Which DTM formula?

Smartzkid

2010-02-24 14:00:31

DTM <-> String

It's only known by three or four people, if I'm correct..

mastaraymond

2010-02-24 14:07:02

From: Smartzkid
DTM <-> String

It's only known by three or four people, if I'm correct..

Well it doesn't require a formula at all ;-). Just a silly way of saving data

Wizzup?

2010-02-24 14:11:29

From: Smartzkid
DTM <-> String

It's only known by three or four people, if I'm correct..


It's in Simba's source code. Not so secret anymore. :)

Smartzkid

2010-02-24 22:21:03

Win! Haha finally, I've been wanting to find it out for a while, thanks :)