Class: Potty::Style
- Inherits:
-
Struct
- Object
- Struct
- Potty::Style
- Defined in:
- lib/potty/style.rb
Overview
A semantic, render-target-agnostic description of how to draw text: symbolic colours (:cyan, :default, :bright_black, …) plus attributes. A Surface resolves a Style to concrete output — curses attributes on a CursesSurface, ANSI SGR codes on an InlineSurface — so the same widget renders to either target unchanged.
Instance Attribute Summary collapse
-
#bg ⇒ Object
Returns the value of attribute bg.
-
#bold ⇒ Object
Returns the value of attribute bold.
-
#fg ⇒ Object
Returns the value of attribute fg.
-
#reverse ⇒ Object
Returns the value of attribute reverse.
-
#underline ⇒ Object
Returns the value of attribute underline.
Instance Method Summary collapse
Instance Attribute Details
#bg ⇒ Object
Returns the value of attribute bg
9 10 11 |
# File 'lib/potty/style.rb', line 9 def bg @bg end |
#bold ⇒ Object
Returns the value of attribute bold
9 10 11 |
# File 'lib/potty/style.rb', line 9 def bold @bold end |
#fg ⇒ Object
Returns the value of attribute fg
9 10 11 |
# File 'lib/potty/style.rb', line 9 def fg @fg end |
#reverse ⇒ Object
Returns the value of attribute reverse
9 10 11 |
# File 'lib/potty/style.rb', line 9 def reverse @reverse end |
#underline ⇒ Object
Returns the value of attribute underline
9 10 11 |
# File 'lib/potty/style.rb', line 9 def underline @underline end |
Instance Method Details
#bold? ⇒ Boolean
10 |
# File 'lib/potty/style.rb', line 10 def bold? = !!bold |
#reverse? ⇒ Boolean
12 |
# File 'lib/potty/style.rb', line 12 def reverse? = !!reverse |
#underline? ⇒ Boolean
11 |
# File 'lib/potty/style.rb', line 11 def underline? = !!underline |