Correction du gamma des couleurs RGB

Run Settings
LanguagePython
Language Version
Run Command
def linearToGammaCorrected(col, name): components = list(map(lambda x: pow(x / 255, 2.2) * 1000 , col)) components = ", ".join([ "{:.2f}".format(c) for c in components ]) print("%(name)s = vec3(%(components)s)" % {'name':name, 'components':components}) sphere_color = [89 , 66 , 54 ] floor_color = [255, 186, 73 ] sky_color = [10 , 157, 255] linearToGammaCorrected(sphere_color, "sphere") linearToGammaCorrected(floor_color, "floor") linearToGammaCorrected(sky_color, "sky")
Editor Settings
Theme
Key bindings
Full width
Lines