class

Opal::UI::Gauge

Inherits Opal::UI::Element < Opal::UI::Themable < Reference < Object

Progress gauge with percentage indicator and custom fill/empty glyphs.

Constructors

new(ratio : Float64, label : String | Nil = nil, color : Color | Symbol | String | Nil = nil, filled_char : Char = '█', empty_char : Char = '░')
Source

Class methods

to_string(ratio : Float64, label : String | Nil = nil, color : Color | Symbol | String | Nil = nil, width : Int32 | Nil = nil, filled_char : Char = '█', empty_char : Char = '░', ansi : Bool | Nil = nil, theme : Theme | Nil = nil) : String

Class convenience method returning styled gauge string

Source

Instance methods

color
Source
empty_char
Source
filled_char
Source
label
Source
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
Source
ratio
Source
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source
resolved_color

Dynamic color based on percentage threshold if no explicit color was set

Source