Module imgui.theme
Theme system for ReaImGui.
Provides pre-built themes and easy color customization.
Info:
- License: MIT
- Author: Nomad Monad
Functions
| rgba (r, g, b, a) | Create an RGBA color from components. |
| hex (hex) | Create an RGBA color from hex string. |
| brighten (color, factor) | Adjust color brightness. |
| with_alpha (color, alpha) | Set color alpha. |
Class Theme
| Theme:new (name, colors) | Create a new theme. |
| Theme:apply (ctx) | Apply theme colors to a context. |
| Theme:unapply (ctx) | Remove theme colors from context. |
| Theme:with (ctx, fn) | Execute a function with this theme applied. |
| theme.Dark | Dark theme (default-ish but refined). |
| theme.Light | Light theme. |
| theme.Reaper | REAPER-inspired theme. |
| theme.HighContrast | High contrast theme for accessibility. |
| theme.Theme | Module Exports |
| theme:create (name, colors) | Create a custom theme. |
| theme:extend (base, name, overrides) | Create a theme by extending an existing one. |
| theme:from_reaper_theme (name) | Create a theme from REAPER's current theme colors. |
Functions
- rgba (r, g, b, a)
-
Create an RGBA color from components.
Parameters:
- r number Red (0-255)
- g number Green (0-255)
- b number Blue (0-255)
- a number|nil Alpha (0-255, default 255)
Returns:
-
number RGBA color value
- hex (hex)
-
Create an RGBA color from hex string.
Parameters:
- hex string Hex color (e.g., "#FF5500" or "FF5500" or "#FF550080")
Returns:
-
number RGBA color value
- brighten (color, factor)
-
Adjust color brightness.
Parameters:
- color number RGBA color
- factor number Brightness factor (1.0 = no change, >1 = brighter, <1 = darker)
Returns:
-
number Adjusted color
- with_alpha (color, alpha)
-
Set color alpha.
Parameters:
- color number RGBA color
- alpha number Alpha (0-255)
Returns:
-
number Color with new alpha
Class Theme
Theme class for managing ImGui colors.
- Theme:new (name, colors)
-
Create a new theme.
Parameters:
- name string Theme name
- colors table Color definitions
Returns:
-
Theme
- Theme:apply (ctx)
-
Apply theme colors to a context.
Parameters:
- ctx Context ImGui context wrapper
- Theme:unapply (ctx)
-
Remove theme colors from context.
Parameters:
- ctx Context ImGui context wrapper
- Theme:with (ctx, fn)
-
Execute a function with this theme applied.
Parameters:
- ctx Context ImGui context wrapper
- fn function Function to execute
- theme.Dark
- Dark theme (default-ish but refined).
- theme.Light
- Light theme.
- theme.Reaper
- REAPER-inspired theme.
- theme.HighContrast
- High contrast theme for accessibility.
- theme.Theme
- Module Exports
- theme:create (name, colors)
-
Create a custom theme.
Parameters:
- name string Theme name
- colors table Color definitions (ImGui_Col_* names without prefix)
Returns:
-
Theme
- theme:extend (base, name, overrides)
-
Create a theme by extending an existing one.
Parameters:
- base Theme Base theme to extend
- name string New theme name
- overrides table Color overrides
Returns:
-
Theme
- theme:from_reaper_theme (name)
-
Create a theme from REAPER's current theme colors.
Reads colors from REAPER's theme and maps them to ImGui colors.
Parameters:
- name string Theme name (default: "REAPER Dynamic")
Returns:
-
Theme