Login
Search for:


Previous | Next

From: Gaia (all posts)
Date: 2001-03-23
Subject: RE: Plus/4 palette
Hi All,

I made some experiments with the Color Hue values Zsolt posted to the list a couple of days ago. I got some help from an excellent document on the VIC-II palette.
(http://www.pepto.de/projects/colorvic)

The result is a calculated plus/4 palette which is quite close to the digitised one, and will allow to add runtime brightness/contrast/gamma setting to the emulator.

However, I had to use some wild guessing at a few places,
because I'm far from being a color expert, and also because of the lack of information.

First I had the Hue values (hue_angle), from which I could calculate the U and V color components (YUV conversion):

U = saturation * COS( hue_angle )
V = saturation * SIN( hue_angle )

I'll come to saturation a bit later. Now on to the luminance levels: the plus/4 have 8 luminence levels, which is effectively 9, if we take into account the black... Here are the luminance voltage levels from a doc:

Luminance Voltage
00 2.00 V
01 2.4 V
02 2.55 V
03 2.7 V
04 2.9 V
05 3.3 V
06 3.6 V
07 4.1 V
08 4.8 V

I'm sure I was wrong, but I used the following equation for normalising the luminances to a 0-255 scale (i is the luminance level index):

Y[i] = (Voltage[i] - 2.0)* 255.0 / (5.0 - 2.0);

I used 5.0 as I guess this is a default max. voltage...
(?!??)
Now comes the saturation... This was rather annoying as I needed some time until I found a workaround. In short, I used "brute force" methods to find suitable saturation values for all luminance levels, so that the resulting RGB components would still be within the valid range [0..255].
I ended up with the following figures (indexed on luminance):

saturation[9] = {
17, 23, 30, 38, 55, 60, 38, 8
};

And from here I could calculate the RGB components based on the following formulae:

R = Y + 1.367 * V G = Y - 0.336 * U - 0.698 * V B = Y + 1.732 * U

The end result, as I mentioned before, is a palette that quite closely resembles a real plus4 palette ( maybe a bit darker). I posted this to the list in the hope that someone could help me make it better. I might send the lastest beta of my emulator that has this new palette, in case someone is interested.

Regards,
Attila

PS. Maybe I could post the palette screengrab to the list?
It's only 3 KB...

Copyright © Plus/4 World Team, 2001-2024