makepad/widgets/sheets/themes/handheld/theme.splash
Admin 53e0e85b92 draw and widgets: Slug text everywhere, no blank glyphs, slimmer widgets
All outline text draws with Slug curves on every platform (SDF/MSDF stays
selectable per size); a frame never presents a blank glyph and retained draw
lists keep theirs. One coverage model for vector feathering, widget families
split out of the core crate, fewer steady-state allocations, video keeps its
aspect (Contain/Cover), render and SSAO pass unification.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 12:26:21 +02:00

225 lines
9.6 KiB
Text

mod.theme = mod.themes.light
// Handheld: the pixel art sheet in the plastic shell of a handheld game
// console, every pane a dot-matrix screen set into it; the controls are the
// pixel sheet's own, and the pixel sheet stays as it was.
// The glass of a handheld's screen, pale green, with a faint dot matrix;
// everything on it is drawn in a few greens on a grid of big pixels two
// device pixels square: chunky ink frames with stepped corners, caps with a
// dark thickness under them, dithered fills, lit pixels where something is
// on. Every state of a family is spelled out, because the base derived its
// states once, from its own colours.
//
// The ladder: ink #0d2117, dark #2f4836, dark two #3e5744, mid #5e7657,
// mute #7b9170, the glass #a0b588, a cap's face #aabd90, the light of a
// bevel #c0cf9f, lit #d6e0b2.
use mod.res.*
use mod.text.*
mod.theme.color_bg_app = #7a8d66
mod.theme.color_fg_app = #879a72
mod.theme.color_bg_container = #879a72
mod.theme.color_surface_container_lowest = #7a8d66
mod.theme.color_bg_even = #7a8d66
mod.theme.color_bg_odd = #7a8d66
// The surface ladder: every rung a shade of the same glass, so the ink
// reads on all of them.
mod.theme.color_surface = #7e9169
mod.theme.color_surface_container = #879a72
mod.theme.color_surface_container_low = #82956d
mod.theme.color_surface_container_high = #8da078
mod.theme.color_surface_container_highest = #93a67e
mod.theme.color_surface_dim = #7a8d66
mod.theme.color_surface_bright = #9bae86
mod.theme.color_on_surface = #0d2117
mod.theme.color_on_surface_variant = #15291d
mod.theme.color_outline = #0d2117
mod.theme.color_outline_variant = #5e7657
// The opposite page (a tooltip, a snackbar) is a dark cell with lit words.
mod.theme.color_inverse_surface = #2f4836
mod.theme.color_inverse_on_surface = #d6e0b2
// Raised faces the sheet does not draw itself: the cap's face.
mod.theme.color_outset = #aabd90
mod.theme.color_outset_1 = #b0c296
mod.theme.color_outset_2 = #a4b78a
mod.theme.color_outset_hover = #b6c79b
mod.theme.color_outset_1_hover = #bccba0
mod.theme.color_outset_2_hover = #b0c296
mod.theme.color_outset_down = #93a87e
mod.theme.color_outset_1_down = #93a87e
mod.theme.color_outset_2_down = #93a87e
mod.theme.color_outset_focus = #aabd90
mod.theme.color_outset_1_focus = #b0c296
mod.theme.color_outset_2_focus = #a4b78a
mod.theme.color_outset_active = #aabd90
mod.theme.color_outset_1_active = #b0c296
mod.theme.color_outset_2_active = #a4b78a
mod.theme.color_outset_disabled = #9aae84
mod.theme.color_outset_1_disabled = #9aae84
mod.theme.color_outset_2_disabled = #9aae84
// Wells the sheet does not draw itself: glass a shade under the ground.
mod.theme.color_inset = #97ac80
mod.theme.color_inset_1 = #97ac80
mod.theme.color_inset_2 = #97ac80
mod.theme.color_inset_hover = #9cb085
mod.theme.color_inset_1_hover = #9cb085
mod.theme.color_inset_2_hover = #9cb085
mod.theme.color_inset_focus = #9cb085
mod.theme.color_inset_1_focus = #9cb085
mod.theme.color_inset_2_focus = #9cb085
mod.theme.color_inset_active = #97ac80
mod.theme.color_inset_1_active = #97ac80
mod.theme.color_inset_2_active = #97ac80
mod.theme.color_inset_down = #93a87e
mod.theme.color_inset_1_down = #93a87e
mod.theme.color_inset_2_down = #93a87e
mod.theme.color_inset_drag = #93a87e
mod.theme.color_inset_1_drag = #93a87e
mod.theme.color_inset_2_drag = #93a87e
mod.theme.color_inset_empty = #97ac80
mod.theme.color_inset_1_empty = #97ac80
mod.theme.color_inset_2_empty = #97ac80
mod.theme.color_inset_disabled = #9aae84
mod.theme.color_inset_1_disabled = #9aae84
mod.theme.color_inset_2_disabled = #9aae84
// Every edge is ink; a disabled one drops to the mid green.
mod.theme.color_bevel = #0d2117
mod.theme.color_bevel_hover = #0d2117
mod.theme.color_bevel_focus = #0d2117
mod.theme.color_bevel_down = #0d2117
mod.theme.color_bevel_active = #0d2117
mod.theme.color_bevel_empty = #0d2117
mod.theme.color_bevel_drag = #0d2117
mod.theme.color_bevel_disabled = #5e7657
mod.theme.color_bevel_inset_1 = #0d2117
mod.theme.color_bevel_inset_2 = #0d2117
mod.theme.color_bevel_outset_1 = #0d2117
mod.theme.color_bevel_outset_2 = #0d2117
mod.theme.beveling = 0.67
// Inks. Words on the glass are the ink; a disabled word sinks to the mid
// green; words on a dark cell are lit, and the faces set those.
mod.theme.color_text = #0d2117
mod.theme.color_text_hover = #0d2117
mod.theme.color_text_focus = #0d2117
mod.theme.color_text_active = #0d2117
mod.theme.color_text_down = #0d2117
mod.theme.color_text_disabled = #4f6a4c
mod.theme.color_text_placeholder = #3a5140
mod.theme.color_text_placeholder_hover = #30473a
mod.theme.color_text_val = #0d2117
mod.theme.color_text_meta = #1e3326
mod.theme.color_text_on_accent = #e8eed6
mod.theme.color_label = #0d2117
mod.theme.color_label_hover = #0d2117
mod.theme.color_label_focus = #0d2117
mod.theme.color_label_active = #0d2117
mod.theme.color_label_down = #0d2117
mod.theme.color_label_disabled = #4f6a4c
mod.theme.color_label_inner = #0d2117
mod.theme.color_label_inner_hover = #0d2117
mod.theme.color_label_inner_focus = #0d2117
mod.theme.color_label_inner_active = #0d2117
mod.theme.color_label_inner_down = #0d2117
mod.theme.color_label_inner_disabled = #4f6a4c
mod.theme.color_label_outer = #0d2117
mod.theme.color_label_outer_hover = #0d2117
mod.theme.color_label_outer_focus = #0d2117
mod.theme.color_label_outer_active = #0d2117
mod.theme.color_label_outer_down = #0d2117
mod.theme.color_label_outer_disabled = #4f6a4c
mod.theme.color_icon = #0d2117
mod.theme.color_icon_hover = #0d2117
mod.theme.color_icon_focus = #0d2117
mod.theme.color_icon_active = #0d2117
mod.theme.color_icon_down = #0d2117
mod.theme.color_icon_disabled = #4f6a4c
// Marks, values and handles: ink, lit where the face draws them on dark.
mod.theme.color_mark = #0d2117
mod.theme.color_mark_active = #0d2117
mod.theme.color_mark_active_hover = #0d2117
mod.theme.color_mark_hover = #0d2117
mod.theme.color_mark_focus = #0d2117
mod.theme.color_mark_down = #0d2117
mod.theme.color_mark_disabled = #5e7657
mod.theme.color_val = #0d2117
mod.theme.color_val_hover = #0d2117
mod.theme.color_val_focus = #0d2117
mod.theme.color_val_drag = #0d2117
mod.theme.color_val_disabled = #5e7657
mod.theme.color_handle = #0d2117
mod.theme.color_handle_hover = #0d2117
mod.theme.color_handle_focus = #0d2117
mod.theme.color_handle_drag = #0d2117
mod.theme.color_handle_disabled = #5e7657
// Selection darkens the glass the way a driven pixel does; the caret is an
// ink block.
mod.theme.color_selection_focus = #2f483666
mod.theme.color_bg_highlight = #2f483633
mod.theme.color_bg_highlight_inline = #2f483640
mod.theme.color_cursor = #0d2117
mod.theme.color_text_cursor = #0d2117
// The accent seed: the primary, secondary and tertiary families are grown
// from `color_ctrl_selected`. A dark teal, the deepest colour a handheld's
// screen shows, so the lit ink on it reads at 8 to 1.
mod.theme.color_ctrl_selected = #1e4a44
// The primary itself is that teal with the lit ink on it, as on every pale
// sheet: a ground dark enough for a light ink. Grown from the seed at the
// family's lightness it came out a bright teal under a dark ink, the one
// pale sheet the other way round, and a mix with any other pale sheet met
// in the middle with neither ink reading.
mod.theme.color_primary = #1e4a44
mod.theme.color_on_primary = #d6e0b2
mod.theme.color_focus = #0d2117
mod.theme.color_ctrl_active = #0d2117
mod.theme.color_terminal_bg = #0d2117
mod.theme.color_terminal_text = #d6e0b2
// Screens, readouts and lamps on this glass are ink on the glass.
mod.theme.color_screen = #a0b588
mod.theme.color_screen_ink = #0d2117
mod.theme.color_lamp_off = #3e5744
mod.theme.color_lamp_plain = #d6e0b2
// Rows of 26 points (the row's grid of big pixels), gaps of 6 inside a
// group and 9 between.
mod.theme.space_factor = 6.0
mod.theme.space_1 = 3.0
mod.theme.space_2 = 6.0
mod.theme.space_3 = 9.0
mod.theme.mspace_1 = mod.turtle.Inset{top: 3.0 right: 3.0 bottom: 3.0 left: 3.0}
// The panes pad past the slot and the glass border of the screen they
// stand in (eleven and a half points), so nothing touches the LCD's edge.
mod.theme.mspace_2 = mod.turtle.Inset{top: 14.0 right: 14.0 bottom: 14.0 left: 14.0}
mod.theme.mspace_3 = mod.turtle.Inset{top: 16.0 right: 16.0 bottom: 16.0 left: 16.0}
mod.theme.size_control_m = 26.0
mod.theme.corner_radius = 0.0
mod.theme.container_corner_radius = 0.0
mod.theme.textselection_corner_radius = 0.0
// A monospaced face, the nearest the resources hold to the pictures' pixel
// type: bold for the words on keys and cells, semibold for what is typed.
// A font size draws 1.333 layout points per unit, so 8.0 is a 10.7 point
// label with a cap of about 7.8 points.
mod.theme.font_size_p = 8.0
mod.theme.type_title_l_size = 11.0
mod.theme.type_title_m_size = 10.0
mod.theme.type_title_s_size = 8.75
mod.theme.type_body_l_size = 8.75
mod.theme.type_body_m_size = 8.0
mod.theme.type_body_s_size = 7.5
mod.theme.type_label_l_size = 8.0
mod.theme.type_label_m_size = 7.5
mod.theme.type_label_s_size = 7.0
mod.theme.font_regular = mod.theme.font_regular{font_size: 8.0 font_family: mod.theme.font_regular.font_family{ibm_plex_text := FontMember{res: crate_resource("makepad_widgets:resources/jetbrains_mono_variable.ttf") weight: 600.0 asc: 0.0 desc: 0.0}}}
mod.theme.font_label = mod.theme.font_label{font_size: 8.0 font_family: mod.theme.font_label.font_family{ibm_plex_text := FontMember{res: crate_resource("makepad_widgets:resources/jetbrains_mono_variable.ttf") weight: 700.0 asc: 0.0 desc: 0.0}}}
mod.theme.font_bold = mod.theme.font_bold{font_size: 8.0 font_family: mod.theme.font_bold.font_family{ibm_plex_semibold := FontMember{res: crate_resource("makepad_widgets:resources/jetbrains_mono_variable.ttf") weight: 800.0 asc: 0.0 desc: 0.0}}}
true