module
Prostore::TUI::Style
Overview
Application-level visual styling — prostore-domain colours and ornaments built on top of tui.cr's generic ANSI/Cell primitives.
tui.cr's TypeStyle knows generic SQL-type coloring. Style knows about prostore concepts (portable types beyond what TypeStyle covers, FKs, validation errors, soft-wrap).
Defined in:
prostore/tui/style.crClass Method Summary
-
.bool_badge(raw : String) : String
Render a raw bool value ("true"/"false"/"1"/"0"/…) as a coloured badge — background colour rather than foreground so it reads as a status chip, not plain text.
-
.error(s : String) : String
Validation error — bright red.
-
.fk_ref(s : String) : String
Foreign-key reference — regular cyan, distinct from all the bright-* data-type colours so FK values read as "linkable".
-
.value(portable_type : String | Nil, type_text : String, s : String) : String
Colour a value by data type.
-
.wrap_cont : String
Soft-wrap continuation marker: dim magenta backslash.
Class Method Detail
Render a raw bool value ("true"/"false"/"1"/"0"/…) as a coloured badge — background colour rather than foreground so it reads as a status chip, not plain text.
Foreign-key reference — regular cyan, distinct from all the bright-* data-type colours so FK values read as "linkable".
Colour a value by data type. Delegates to tui.cr's TypeStyle for the generic SQL types it covers (ints, floats, bool, time, bytes); for prostore-only categories it doesn't know about (uuid, json, native enums), falls back to prostore's own colour choices so those types don't silently lose their colouring.
Soft-wrap continuation marker: dim magenta backslash. Signals that the logical value continues on the next display line.