~bduggan/raku-terminal-ui

ref: 0.1.1 raku-terminal-ui/lib/Terminal/UI/Style.rakumod -rw-r--r-- 602 bytes
f5a6d218Brian Duggan docs 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
unit class Terminal::UI::Style;

method pod { $=pod }

#| Color for the selected row, when the pane is focused and when it is not
has %.colors is rw =
  focused   => { selected => { fg => 15, bg => 22 } },
  unfocused => { selected => { fg => 15, bg => 236 } }
;

my $s;

#| Same as singleton
method new(*%named) {
  $s //= self.bless(|%named)
}

#| Get the singleton object.
method singleton {
  Terminal::UI::Style.new;
}

=NAME Terminal::UI::Style -- Global style for UI elements

=begin DESCRIPTION

This is a singleton class which keeps track of a global
style for UI elements.

=end DESCRIPTION