ルックアップ テーブルを使用する必要があり、浮動小数点データを扱っている場合は、浮動小数点データを個別の範囲に量子化し、テーブル内の各範囲をルックアップする必要があります。
ただし、ここではルックアップ テーブルを使用するのは適切ではないようです。float 値を入力として受け取り、RGB 値を返すマッピング関数を定義してみませんか? これをフラクタルの色付けに使用しました ( http://jk.ozlabs.org/projects/lca2008-hackfest/の「色付け」セクションを参照)。
基本的に、私のアプローチは、彩度と値に定数値を使用し、色相に浮動小数点入力データを使用して、単純化された HSV から RSB への変換を行うことです。これにより、値に次の RGB 出力が与えられます。

このマッピング関数を使用して色付けされたフラクタルについては、 http://jk.ozlabs.org/blog/post/65/hackfest08-solution-2/を参照してください。
これを行うためのCコードがいくつかありますが、これは簡単にPythonに変換できます。これは 0 <= i <= 1 を想定していますが、おそらく -1 <= i <= 1 が必要であることに注意してください。
/* for a value x (which is between x_min and x_max), interpolate a y value
* (between y_min and y_max) of the same proportion.
*/
static float interpolate(float x, float x_min, float x_max,
float y_min, float y_max)
{
x = (x - x_min) / (x_max - x_min);
return x * (y_max - y_min) + y_min;
}
/*
* given a the i and i_max values from a point in our (x,y) coordinates,
* compute the colour of the pixel at that point.
*
* This function does a simplified Hue,Saturation,Value transformation to
* RGB. We take i/i_max as the Hue, and keep the saturation and value
* components fixed.
*/
void colour_map(struct pixel *pix, float i, float i_max)
{
const float saturation = 0.8;
const float value = 0.8;
float v_min, hue;
hue = i / (i_max + 1);
v_min = value * (1 - saturation);
/* create two linear curves, between value and v_min, of the
* proportion of a colour to include in the rgb output. One
* is ascending over the 60 degrees, the other descending
*/
if (hue < 0.25) {
pix->r = value * 255;
pix->g = interpolate(hue, 0.0, 0.25, v_min, value) * 255;
pix->b = v_min * 255;
} else if (hue < 0.5) {
pix->r = interpolate(hue, 0.25, 0.5, value, v_min) * 255;
pix->g = value * 255;
pix->b = v_min * 255;
} else if (hue < 0.75) {
pix->r = v_min * 255;
pix->g = value * 255;
pix->b = interpolate(hue, 0.5, 0.75, v_min, value) * 255;
} else {
pix->r = v_min * 255;
pix->g = interpolate(hue, 0.75, 1.0, value, v_min) * 255;
pix->b = value * 255;
}
pix->a = 255;
}