Be warned that it forbids you the use of the camera and show-layer-at statements, and that passing excessive values will make the screen entirely black, white or gray and in that case you won't be able to change them using the GUI (which will be invisible).
Code: Select all
init python:
import functools
def layer_color_function(trans, st, at):
trans.matrixcolor = BrightnessMatrix(persistent.brig)*ContrastMatrix(persistent.cont)
return None
define layer_color = Transform(function=layer_color_function)
default persistent.brig = 0.
default persistent.cont = 1.
define config.after_default_callbacks += [functools.partial(renpy.show_layer_at, [layer_color], "screens", camera=True),
functools.partial(renpy.show_layer_at, [layer_color], "master", camera=True)]
Code: Select all
label _("Brightness")
bar value FieldValue(persistent, "brig", 2., style="slider_slider", offset=-1)
label _("Contrast")
bar value FieldValue(persistent, "cont", 2., style="slider_slider")