LDraw.org Discussion Forums

Full Version: Translate old colour codes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Many old parts use a blended colour code. A mix of two ldraw base colours.
New parts can have a RGB-based colour code
Both are ways to create a colour not present in ldconfig.ldr

Is there a way to 'translate' the old code to a new code?
Yes, you only need to calculate the RGB of the dithered color code by applying the known base colors from the LDConfig, like so (c++ pseudo)

Code:
A=(code-256) >> 4
B=(code-256) & 0x0F

r=(A.r+B.r)/2.0
g=(A.g+B.g)/2.0
b=(A.b+B.b)/2.0

edit: forgot the -256
Color on printed stuff is so imprecise (pigment mismatch, plastic color bleeding through and so on) that I think the best way is to visually match color with an existing ldconfig color. Don't forget also that initial dithered color was eyeballed too, probably using an uncalibrated monitor to match color...
Thanks Roland, but I don't speak 'code'. I don't even know how to read that math.
Is there a tool that can do that calculation? ColourManager?

I'm reworking many of the torsos from the early Pirates. They all need to become BFC compliant.

All files use the same code 486. Some sort of light brown leather. But all the pictures show different shades of brown, as Philo says.
Reddish brown is to dark. I think I'll go with Medium Dark Flesh

[attachment=1441]
I understand the code in the following way:
To get the new value for red/green/blue you have to sum the red/green/blue values and divide it by two.

An example:
You want to mix the LDraw-Colours blue (1) and Orange (25)
RGB of blue: 0055BF
RGB of orange: FE8A18

Now take the first to positions: 00 and FE -> sum is FE -> divide by two makes 7F
Now position three and four: 55 and 8A -> sum is DF -> divide by two makes 6F
Now position five and six: BF and 18 -> sum is D7 -> divide by two makes 6B

New colour is 7F6F6B

Please note that the windows calculator can handle hex data in the programmer mode (Win Vista and Win 7).

/Max
I just programmed a small tool for this purpose
Comments are welcome (a symbol as well).

/Max
Quote:RGB of blue: 0055BF
RGB of orange: FE8A18
That's current definition of blue and orange per ldconfig, but certainly not the RGB values of EGA/VGA era when this mix was defined... And it would be nice if the tool computed the closest ldconfig color.
Yes, this would be an idea... I have to think about this, cause my programming skills are a bit limited. Anyway, I'll give it a try the next days...
Okay, I have a basic idea on how to do this...

/Max
Thanks a lot, it works fine.

Maybe some sort of blended colour wheel?

[attachment=1444]
Is there any copyright on this colour wheel?

/Max
Pages: 1 2