Modify the RGB scale formula

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2070 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2014-02-15 17:34:43 +00:00
parent e19026860d
commit c821dbebf4

View File

@ -77,7 +77,7 @@ int Get_palette_RGB_scale(void)
/// The result is also in the 0-255 range. /// The result is also in the 0-255 range.
byte Round_palette_component(byte comp) byte Round_palette_component(byte comp)
{ {
return ((comp+128/RGB_scale)*(RGB_scale-1)/255*255+(RGB_scale&1?1:0))/(RGB_scale-1); return (comp*RGB_scale/256+(RGB_scale-(256-1)*RGB_scale/256)/2) * (255/(RGB_scale-1));
} }
/// ///