class

Tui::Digits

Inherits Tui::Widget / Tui::Reactive / Reference / Object

Constants

DIGIT_HEIGHT = 5
DIGIT_WIDTH = 3
PATTERNS = {'0' => ["┌─┐", "│ │", "│ │", "│ │", "└─┘"], '1' => [" ┐", " │", " │", " │", " ╵"], '2' => ["┌─┐", " │", "┌─┘", "│ ", "└─┘"], '3' => ["┌─┐", " │", " ─┤", " │", "└─┘"], '4' => ["╷ ╷", "│ │", "└─┤", " │", " ╵"], '5' => ["┌─┐", "│ ", "└─┐", " │", "└─┘"], '6' => ["┌─┐", "│ ", "├─┐", "│ │", "└─┘"], '7' => ["┌─┐", " │", " │", " │", " ╵"], '8' => ["┌─┐", "│ │", "├─┤", "│ │", "└─┘"], '9' => ["┌─┐", "│ │", "└─┤", " │", "└─┘"], '-' => [" ", " ", "───", " ", " "], '+' => [" ", " │ ", "─┼─", " │ ", " "], '.' => [" ", " ", " ", " ", " ● "], ':' => [" ", " ● ", " ", " ● ", " "], ' ' => [" ", " ", " ", " ", " "]}

3x5 digit patterns (each digit is 3 chars wide, 5 lines tall)

SPACING = 1

Constructors

new(id : String | Nil = nil, value : String = "0")
Source

Instance methods

dim_style
Source
dim_style=(dim_style : Style)
Source
min_size
Source
number=(num : Int32 | Int64 | Float64) : Nil

Set numeric value

Source
render(buffer : Buffer, clip : Rect) : Nil

Override to render widget content

Source
style
Source
style=(style : Style)
Source
time=(t : Time) : Nil

Set time value (HH:MM:SS)

Source
value
Source
value=(value : String)
Source