jxxcarlson/scripta-compiler-v2/1.3.0

Render.Theme

Theme support for Scripta rendering.

This module provides light and dark themes for rendering Scripta documents, with support for both raw Color values and elm-ui Element.Color.

Types

type Theme
= Light
| Dark

Represents the available themes.

type alias ActualTheme =
{ background : Color
, text : Color
, codeBackground : Color
, codeText : Color
, offsetBackground : Color
, offsetText : Color
, link : Color
, footnote : Color
, highlight : Color
}

A theme's color palette, containing colors for various UI elements.

Theme Selection

getColor : Theme -> (ActualTheme -> Color) -> Color

Get a Color value from the selected theme.

myTextColor =
    getColor Light .text
getElementColor : Theme -> (ActualTheme -> Color) -> Color

Get an Element.Color value from the selected theme. This is useful when working with elm-ui.

myBackgroundColor =
    getElementColor Dark .background

Predefined Themes

lightTheme : ActualTheme

The predefined light theme with professional, readable colors.

darkTheme : ActualTheme

The predefined dark theme with reduced eye strain for low-light environments.