feat(theme): add tone mapping and fix missing palette colors
This commit is contained in:
@@ -4567,6 +4567,27 @@ def render_theme_panel(app: App) -> None:
|
||||
app._flush_to_config()
|
||||
models.save_config(app.config)
|
||||
|
||||
imgui.separator()
|
||||
imgui.text("Tone Mapping (Per-Palette)")
|
||||
curr_p = theme.get_current_palette()
|
||||
|
||||
imgui.text("Brightness")
|
||||
ch_b, b = imgui.slider_float("##tm_b", theme.get_brightness(curr_p), 0.1, 2.0, "%.2f")
|
||||
if ch_b: theme.set_brightness(curr_p, b); app._flush_to_config(); models.save_config(app.config)
|
||||
|
||||
imgui.text("Contrast")
|
||||
ch_c, c = imgui.slider_float("##tm_c", theme.get_contrast(curr_p), 0.1, 2.0, "%.2f")
|
||||
if ch_c: theme.set_contrast(curr_p, c); app._flush_to_config(); models.save_config(app.config)
|
||||
|
||||
imgui.text("Gamma")
|
||||
ch_g, g = imgui.slider_float("##tm_g", theme.get_gamma(curr_p), 0.1, 3.0, "%.2f")
|
||||
if ch_g: theme.set_gamma(curr_p, g); app._flush_to_config(); models.save_config(app.config)
|
||||
|
||||
if imgui.button("Reset Tone Mapping"):
|
||||
theme.reset_tone_mapping(curr_p)
|
||||
app._flush_to_config()
|
||||
models.save_config(app.config)
|
||||
|
||||
imgui.end()
|
||||
if app.perf_profiling_enabled: app.perf_monitor.end_component("_render_theme_panel")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user