It is good way to convert color from Linear space from 0.0 to 1.0 into sRGB space from 0 to 255 by using Lookup table in this manner?
Example, in Java:
byte[] table;
void initializeTable()
{
table = new byte[65536];
for(int i = 0; i < table.length; i++){
float Lin = i / (float) (table.length-1);
if(Lin<=0.0031308f)
table[i] = (byte)(255*(Lin*12.92f));
else
table[i] = (byte)(255*( (1+0.055f)*Math.pow(Lin,1/2.4f)-0.055f) );
}
}
int sRGB(float Linear/*in range 0..1*/) // Will return 0..255 integer sRGB
{
return 255 & table[(int)( Linear*(table.length-1) )];
}