Daedolon, on 02 January 2014 - 09:21 AM, said:
How did you calculate that?
Using some home-brewed Octave code, found
here. It's all data plotting though, no real calculation involved. If you want to reproduce it, you'll have to compile Octave from source. The official binary packages don't ship with classdef support yet, but it has recently been merged into the default branch.
Quote
And can you make a "perfect" palette (for the 256 colours anyway) that fixes those gradients?
Well, you can create one whose colors will be closest to linearly-blended ones (for a given distance function; in transpal.exe it's the squared Euclidean distance, with a weighting on the color components). However, it turns out that it's not even desirable. Try running the following from the latest Lunatic Mapster32's OSD, with quotes entered as shown:
lua "shadexfog=reload'shadexfog'"
lua "shadexfog.create0(100)"
Now, switch to the newly created pal with
lua "shadexfog.challpal(100)"
You'll notice that the result is quite inferior to what the shipped shade table provides. I think it's been generated similar to this: Assume that the base palette contains all color ramps in consecutive blocks (like in the
rearranged base palette colors plot on the
wiki) and for a color index i, let b(i) denote the least color index belonging to the same ramp as i (the "base" color index of that ramp). Then, for a shade s and a color index i, palookup[s][i] = b(i) + round((s/32)*(i - b(i))). In a sense, this is a good thing, as it means that shaded versions of a color stay within their ramp.
edit: corrected the formula