whirled_peas 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -2
- data/CHANGELOG.md +5 -0
- data/README.md +7 -1156
- data/doc/application.md +92 -0
- data/doc/cli.md +115 -0
- data/doc/components.md +55 -0
- data/doc/easing.md +257 -0
- data/doc/elements.md +69 -0
- data/doc/screen_test.md +23 -0
- data/doc/settings.md +466 -0
- data/doc/template_factory.md +53 -0
- data/doc/themes.md +15 -0
- data/lib/data/themes.yaml +8 -4
- data/lib/whirled_peas/component/list_with_active.rb +3 -3
- data/lib/whirled_peas/graphics/container_coords.rb +2 -26
- data/lib/whirled_peas/graphics/container_dimensions.rb +24 -0
- data/lib/whirled_peas/graphics/container_painter.rb +26 -28
- data/lib/whirled_peas/graphics/debugger.rb +1 -0
- data/lib/whirled_peas/graphics/graph_painter.rb +31 -24
- data/lib/whirled_peas/graphics/scrollbar_helper.rb +31 -29
- data/lib/whirled_peas/settings/bg_color.rb +5 -1
- data/lib/whirled_peas/settings/border.rb +1 -1
- data/lib/whirled_peas/settings/color.rb +8 -4
- data/lib/whirled_peas/settings/debugger.rb +2 -0
- data/lib/whirled_peas/settings/element_settings.rb +10 -2
- data/lib/whirled_peas/settings/text_color.rb +5 -0
- data/lib/whirled_peas/settings/theme.rb +28 -7
- data/lib/whirled_peas/settings/theme_library.rb +10 -4
- data/lib/whirled_peas/version.rb +1 -1
- data/screen_test/components/list_with_active/l2r_position_start.frame +1 -1
- data/screen_test/components/list_with_active/l2r_separator.frame +1 -1
- data/screen_test/components/list_with_active/t2b_position_start.frame +1 -1
- data/screen_test/components/list_with_active/t2b_separator.frame +1 -1
- data/screen_test/elements/{graph.frame → graph_asc.frame} +1 -1
- data/screen_test/elements/{graph.rb → graph_asc.rb} +0 -0
- data/screen_test/elements/graph_desc.frame +1 -0
- data/screen_test/elements/graph_desc.rb +12 -0
- data/screen_test/elements/graph_horiz.frame +1 -0
- data/screen_test/elements/graph_horiz.rb +12 -0
- data/screen_test/elements/graph_sin.frame +1 -0
- data/screen_test/elements/graph_sin.rb +12 -0
- data/screen_test/elements/theme.frame +1 -1
- data/screen_test/settings/scroll/horiz_box.frame +1 -1
- data/screen_test/settings/scroll/vert_box.frame +1 -1
- metadata +19 -6
- data/bin/easing +0 -33
- data/lib/whirled_peas/graphics/mock_screen.rb +0 -26
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'whirled_peas/utils/ansi'
|
2
2
|
|
3
3
|
require_relative 'color'
|
4
|
+
require_relative 'text_color'
|
4
5
|
|
5
6
|
module WhirledPeas
|
6
7
|
module Settings
|
7
8
|
class BgColor < Color
|
8
9
|
BG_OFFSET = 10
|
9
|
-
private_constant :BG_OFFSET
|
10
10
|
|
11
11
|
BLACK = new(Utils::Ansi::BLACK + BG_OFFSET)
|
12
12
|
RED = new(Utils::Ansi::RED + BG_OFFSET)
|
@@ -19,6 +19,10 @@ module WhirledPeas
|
|
19
19
|
GRAY = BLACK.bright
|
20
20
|
|
21
21
|
DEFAULT = nil # Use system defined default
|
22
|
+
|
23
|
+
def as_text_color
|
24
|
+
TextColor.new(code - BG_OFFSET, bright?)
|
25
|
+
end
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
@@ -43,11 +43,11 @@ module WhirledPeas
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def bright
|
46
|
-
bright? ? self : self.class.new(
|
46
|
+
bright? ? self : self.class.new(code + Utils::Ansi::BRIGHT_OFFSET, true)
|
47
47
|
end
|
48
48
|
|
49
49
|
def hash
|
50
|
-
[
|
50
|
+
[code, bright].hash
|
51
51
|
end
|
52
52
|
|
53
53
|
def ==(other)
|
@@ -56,12 +56,16 @@ module WhirledPeas
|
|
56
56
|
alias_method :eq?, :==
|
57
57
|
|
58
58
|
def to_s
|
59
|
-
|
59
|
+
code.to_s
|
60
60
|
end
|
61
61
|
|
62
62
|
def inspect
|
63
|
-
"#{self.class.name.split('::').last}(code=#{
|
63
|
+
"#{self.class.name.split('::').last}(code=#{code}, bright=#{bright?})"
|
64
64
|
end
|
65
|
+
|
66
|
+
private
|
67
|
+
|
68
|
+
attr_reader :code
|
65
69
|
end
|
66
70
|
private_constant :Color
|
67
71
|
end
|
@@ -27,7 +27,11 @@ module WhirledPeas
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def bg_color=(color)
|
30
|
-
|
30
|
+
if color == :highlight
|
31
|
+
@_bg_color = theme.highlight_bg_color
|
32
|
+
else
|
33
|
+
@_bg_color = BgColor.validate!(color)
|
34
|
+
end
|
31
35
|
end
|
32
36
|
|
33
37
|
def bold?
|
@@ -43,7 +47,11 @@ module WhirledPeas
|
|
43
47
|
end
|
44
48
|
|
45
49
|
def color=(color)
|
46
|
-
|
50
|
+
if color == :highlight
|
51
|
+
@_color = theme.highlight_color
|
52
|
+
else
|
53
|
+
@_color = TextColor.validate!(color)
|
54
|
+
end
|
47
55
|
end
|
48
56
|
|
49
57
|
def underline?
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'whirled_peas/utils/ansi'
|
2
2
|
|
3
|
+
require_relative 'bg_color'
|
3
4
|
require_relative 'color'
|
4
5
|
|
5
6
|
module WhirledPeas
|
@@ -16,6 +17,10 @@ module WhirledPeas
|
|
16
17
|
GRAY = BLACK.bright
|
17
18
|
|
18
19
|
DEFAULT = nil # Use system defined default
|
20
|
+
|
21
|
+
def as_bg_color
|
22
|
+
BgColor.new(code + BgColor::BG_OFFSET, bright?)
|
23
|
+
end
|
19
24
|
end
|
20
25
|
end
|
21
26
|
end
|
@@ -1,15 +1,20 @@
|
|
1
1
|
require 'whirled_peas/utils/title_font'
|
2
2
|
|
3
3
|
require_relative 'bg_color'
|
4
|
+
require_relative 'border'
|
4
5
|
require_relative 'text_color'
|
5
6
|
|
6
7
|
module WhirledPeas
|
7
8
|
module Settings
|
8
9
|
class Theme
|
9
|
-
attr_reader :
|
10
|
+
attr_reader :bg_color, :border_style, :color, :title_font
|
10
11
|
|
11
|
-
def
|
12
|
-
@
|
12
|
+
def axis_color=(value)
|
13
|
+
@axis_color = TextColor.validate!(value)
|
14
|
+
end
|
15
|
+
|
16
|
+
def axis_color
|
17
|
+
@axis_color || border_color
|
13
18
|
end
|
14
19
|
|
15
20
|
def bg_color=(value)
|
@@ -24,12 +29,28 @@ module WhirledPeas
|
|
24
29
|
@border_color || color
|
25
30
|
end
|
26
31
|
|
27
|
-
def
|
28
|
-
@
|
32
|
+
def border_style=(value)
|
33
|
+
@border_style = Border::Styles.validate!(value)
|
29
34
|
end
|
30
35
|
|
31
|
-
def
|
32
|
-
@
|
36
|
+
def color=(value)
|
37
|
+
@color = TextColor.validate!(value)
|
38
|
+
end
|
39
|
+
|
40
|
+
def highlight_bg_color=(value)
|
41
|
+
@highlight_bg_color = BgColor.validate!(value)
|
42
|
+
end
|
43
|
+
|
44
|
+
def highlight_bg_color
|
45
|
+
@highlight_bg_color || color.as_bg_color
|
46
|
+
end
|
47
|
+
|
48
|
+
def highlight_color=(value)
|
49
|
+
@highlight_color = TextColor.validate!(value)
|
50
|
+
end
|
51
|
+
|
52
|
+
def highlight_color
|
53
|
+
@highlight_color || bg_color.as_text_color
|
33
54
|
end
|
34
55
|
|
35
56
|
def title_font=(value)
|
@@ -39,14 +39,20 @@ module WhirledPeas
|
|
39
39
|
theme = Theme.new
|
40
40
|
settings.each do |key, value|
|
41
41
|
case key
|
42
|
-
when '
|
43
|
-
theme.
|
42
|
+
when 'axis_color'
|
43
|
+
theme.axis_color = value
|
44
44
|
when 'bg_color'
|
45
45
|
theme.bg_color = value
|
46
46
|
when 'border_color'
|
47
47
|
theme.border_color = value
|
48
|
-
when '
|
49
|
-
theme.
|
48
|
+
when 'border_style'
|
49
|
+
theme.border_style = value
|
50
|
+
when 'color'
|
51
|
+
theme.color = value
|
52
|
+
when 'highlight_bg_color'
|
53
|
+
theme.highlight_bg_color = value
|
54
|
+
when 'highlight_color'
|
55
|
+
theme.highlight_color = value
|
50
56
|
when 'title_font'
|
51
57
|
theme.title_font = value
|
52
58
|
else
|
data/lib/whirled_peas/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┏━━━━━━━━━━┓[0m[2;1H[97m[40m┃ ┃[0m[3;1H[97m[40m
|
1
|
+
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┏━━━━━━━━━━┓[0m[2;1H[97m[40m┃ ┃[0m[3;1H[97m[40m┃▄▄▄▄ ┃[0m[4;1H[97m[40m┗━━━━━━━━━━┛[0m[2;2H[97m[40mA[0m[2;3H[97m[40mB[0m[2;4H[97m[40mC[0m[2;5H[97m[40mD[0m[2;6H[97m[40mE[0m[2;7H[97m[40mF[0m[2;8H[97m[40mG[0m[2;9H[97m[40mH[0m[2;10H[97m[40mI[0m[2;11H[97m[40mJ[0m[0m[24;1H[?25h
|
@@ -1 +1 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┏━━━━━━━━━━┓[0m[2;1H[97m[40m┃ ┃[0m[3;1H[97m[40m┃
|
1
|
+
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┏━━━━━━━━━━┓[0m[2;1H[97m[40m┃ ┃[0m[3;1H[97m[40m┃ ▗▄ ┃[0m[4;1H[97m[40m┗━━━━━━━━━━┛[0m[2;2H[97m[40mL[0m[2;3H[97m[40m, [0m[2;5H[97m[40mM[0m[2;6H[97m[40m, [0m[2;8H[97m[40mN[0m[2;9H[97m[40m, [0m[2;11H[97m[40mO[0m[0m[24;1H[?25h
|
@@ -1 +1 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┏━━┓[0m[2;1H[97m[40m┃ ▐┃[0m[3;1H[97m[40m┃ ▐┃[0m[4;1H[97m[40m┃ ▐┃[0m[5;1H[97m[40m┃
|
1
|
+
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┏━━┓[0m[2;1H[97m[40m┃ ▐┃[0m[3;1H[97m[40m┃ ▐┃[0m[4;1H[97m[40m┃ ▐┃[0m[5;1H[97m[40m┃ ▐┃[0m[6;1H[97m[40m┃ ┃[0m[7;1H[97m[40m┃ ┃[0m[8;1H[97m[40m┃ ┃[0m[9;1H[97m[40m┃ ┃[0m[10;1H[97m[40m┃ ┃[0m[11;1H[97m[40m┃ ┃[0m[12;1H[97m[40m┗━━┛[0m[2;2H[97m[40mA[0m[3;2H[97m[40mB[0m[4;2H[97m[40mC[0m[5;2H[97m[40mD[0m[6;2H[97m[40mE[0m[7;2H[97m[40mF[0m[8;2H[97m[40mG[0m[9;2H[97m[40mH[0m[10;2H[97m[40mI[0m[11;2H[97m[40mJ[0m[0m[24;1H[?25h
|
@@ -1 +1 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┏━━┓[0m[2;1H[97m[40m┃ ┃[0m[3;1H[97m[40m┃ ┃[0m[4;1H[97m[40m┃ ┃[0m[5;1H[97m[40m┃
|
1
|
+
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┏━━┓[0m[2;1H[97m[40m┃ ┃[0m[3;1H[97m[40m┃ ┃[0m[4;1H[97m[40m┃ ┃[0m[5;1H[97m[40m┃ ┃[0m[6;1H[97m[40m┃ ▐┃[0m[7;1H[97m[40m┃ ▐┃[0m[8;1H[97m[40m┃ ┃[0m[9;1H[97m[40m┃ ┃[0m[10;1H[97m[40m┃ ┃[0m[11;1H[97m[40m┃ ┃[0m[12;1H[97m[40m┗━━┛[0m[2;2H[97m[40mK[0m[3;2H[97m[40m-[0m[4;2H[97m[40mL[0m[5;2H[97m[40m-[0m[6;2H[97m[40mM[0m[7;2H[97m[40m-[0m[8;2H[97m[40mN[0m[9;2H[97m[40m-[0m[10;2H[97m[40mO[0m[11;2H[97m[40m-[0m[0m[24;1H[?25h
|
@@ -1 +1 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┃[0m[1;2H[97m[40m
|
1
|
+
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┃[0m[1;2H[97m[40m █[0m[2;1H[97m[40m┃[0m[2;2H[97m[40m █[0m[3;1H[97m[40m┃[0m[3;2H[97m[40m █[0m[4;1H[97m[40m┃[0m[4;2H[97m[40m ▄▀[0m[5;1H[97m[40m┃[0m[5;2H[97m[40m █ [0m[6;1H[97m[40m┃[0m[6;2H[97m[40m █ [0m[7;1H[97m[40m┃[0m[7;2H[97m[40m █ [0m[8;1H[97m[40m┃[0m[8;2H[97m[40m █ [0m[9;1H[97m[40m┃[0m[9;2H[97m[40m █ [0m[10;1H[97m[40m┃[0m[10;2H[97m[40m ▄▀ [0m[11;1H[97m[40m┃[0m[11;2H[97m[40m▄▄▀ [0m[12;1H[97m[40m┗━━━━━━━━━[0m[0m[24;1H[?25h
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┃[0m[1;2H[97m[40m ▀▄ [0m[2;1H[97m[40m┃[0m[2;2H[97m[40m ▀▄ [0m[3;1H[97m[40m┃[0m[3;2H[97m[40m █ [0m[4;1H[97m[40m┃[0m[4;2H[97m[40m █ [0m[5;1H[97m[40m┃[0m[5;2H[97m[40m █ [0m[6;1H[97m[40m┃[0m[6;2H[97m[40m █ [0m[7;1H[97m[40m┃[0m[7;2H[97m[40m █ [0m[8;1H[97m[40m┃[0m[8;2H[97m[40m ▀▄[0m[9;1H[97m[40m┃[0m[9;2H[97m[40m █[0m[10;1H[97m[40m┃[0m[10;2H[97m[40m █[0m[11;1H[97m[40m┃[0m[11;2H[97m[40m █[0m[12;1H[97m[40m┗━━━━━━━━━[0m[0m[24;1H[?25h
|
@@ -0,0 +1 @@
|
|
1
|
+
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┃[0m[1;2H[97m[40m [0m[2;1H[97m[40m┃[0m[2;2H[97m[40m [0m[3;1H[97m[40m┃[0m[3;2H[97m[40m [0m[4;1H[97m[40m┃[0m[4;2H[97m[40m [0m[5;1H[97m[40m┃[0m[5;2H[97m[40m [0m[6;1H[97m[40m┃[0m[6;2H[97m[40m▀▀▀▀▀▀▀▀▀[0m[7;1H[97m[40m┃[0m[7;2H[97m[40m [0m[8;1H[97m[40m┃[0m[8;2H[97m[40m [0m[9;1H[97m[40m┃[0m[9;2H[97m[40m [0m[10;1H[97m[40m┃[0m[10;2H[97m[40m [0m[11;1H[97m[40m┃[0m[11;2H[97m[40m [0m[12;1H[97m[40m┗━━━━━━━━━[0m[0m[24;1H[?25h
|
@@ -0,0 +1 @@
|
|
1
|
+
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┃[0m[1;2H[97m[40m ▄▀▄ [0m[2;1H[97m[40m┃[0m[2;2H[97m[40m █ █ [0m[3;1H[97m[40m┃[0m[3;2H[97m[40m █ █ [0m[4;1H[97m[40m┃[0m[4;2H[97m[40m █ █ [0m[5;1H[97m[40m┃[0m[5;2H[97m[40m█ █ [0m[6;1H[97m[40m┃[0m[6;2H[97m[40m▀ █ ▄[0m[7;1H[97m[40m┃[0m[7;2H[97m[40m █ █[0m[8;1H[97m[40m┃[0m[8;2H[97m[40m █ █[0m[9;1H[97m[40m┃[0m[9;2H[97m[40m █ █[0m[10;1H[97m[40m┃[0m[10;2H[97m[40m █ █ [0m[11;1H[97m[40m┃[0m[11;2H[97m[40m ▀▄▀ [0m[12;1H[97m[40m┗━━━━━━━━━━━━[0m[0m[24;1H[?25h
|
@@ -1 +1 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[92m[107m┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[92m[107m┃ ┃[0m[3;1H[92m[107m┃ ┃[0m[4;1H[92m[107m┃ ┃[0m[5;1H[92m[107m┃ ┃[0m[6;1H[92m[107m┃ ┃[0m[7;1H[92m[107m┃ ┃[0m[8;1H[92m[107m┃ ┃[0m[9;1H[92m[107m┃ ┃[0m[10;1H[92m[107m┃ ┃[0m[11;1H[92m[107m┃ ┃[0m[12;1H[92m[107m┃ ┃[0m[13;1H[92m[107m┃ ┃[0m[14;1H[92m[107m┃ ┃[0m[15;1H[92m[107m┃ ┃[0m[16;1H[92m[107m┃ ┃[0m[17;1H[92m[107m┃ ┃[0m[18;1H[92m[107m┃ ┃[0m[19;1H[92m[107m┃ ┃[0m[20;1H[92m[107m┃ ┃[0m[21;1H[92m[107m┃ ┃[0m[22;1H[92m[107m┃ ┃[0m[23;1H[92m[107m┃ ┃[0m[24;1H[92m[107m┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;2H[34m[107m ██████╗ ██████╗ ██╗ ██╗[0m[3;2H[34m[107m██╔═══██╗██╔═══██╗██║ ██║[0m[4;2H[34m[107m██║ ██║██║ ██║███████║[0m[5;2H[34m[107m██║ ██║██║ ██║██╔══██║[0m[6;2H[34m[107m╚██████╔╝╚██████╔╝██║ ██║[0m[7;2H[34m[107m ╚═════╝ ╚═════╝ ╚═╝ ╚═╝[0m[8;2H[91m[107m┃[0m[8;3H[34m[107m
|
1
|
+
[?25l[1;1H[J[1;1H[92m[107m┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[92m[107m┃ ┃[0m[3;1H[92m[107m┃ ┃[0m[4;1H[92m[107m┃ ┃[0m[5;1H[92m[107m┃ ┃[0m[6;1H[92m[107m┃ ┃[0m[7;1H[92m[107m┃ ┃[0m[8;1H[92m[107m┃ ┃[0m[9;1H[92m[107m┃ ┃[0m[10;1H[92m[107m┃ ┃[0m[11;1H[92m[107m┃ ┃[0m[12;1H[92m[107m┃ ┃[0m[13;1H[92m[107m┃ ┃[0m[14;1H[92m[107m┃ ┃[0m[15;1H[92m[107m┃ ┃[0m[16;1H[92m[107m┃ ┃[0m[17;1H[92m[107m┃ ┃[0m[18;1H[92m[107m┃ ┃[0m[19;1H[92m[107m┃ ┃[0m[20;1H[92m[107m┃ ┃[0m[21;1H[92m[107m┃ ┃[0m[22;1H[92m[107m┃ ┃[0m[23;1H[92m[107m┃ ┃[0m[24;1H[92m[107m┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;2H[34m[107m ██████╗ ██████╗ ██╗ ██╗[0m[3;2H[34m[107m██╔═══██╗██╔═══██╗██║ ██║[0m[4;2H[34m[107m██║ ██║██║ ██║███████║[0m[5;2H[34m[107m██║ ██║██║ ██║██╔══██║[0m[6;2H[34m[107m╚██████╔╝╚██████╔╝██║ ██║[0m[7;2H[34m[107m ╚═════╝ ╚═════╝ ╚═╝ ╚═╝[0m[8;2H[91m[107m┃[0m[8;3H[34m[107m ▄▄▀[0m[9;2H[91m[107m┃[0m[9;3H[34m[107m ▄▀▀ [0m[10;2H[91m[107m┃[0m[10;3H[34m[107m ▄▄▀ [0m[11;2H[91m[107m┃[0m[11;3H[34m[107m ▄▀ [0m[12;2H[91m[107m┃[0m[12;3H[34m[107m ▄▀ [0m[13;2H[91m[107m┃[0m[13;3H[34m[107m ▄▀ [0m[14;2H[91m[107m┃[0m[14;3H[34m[107m ▄▀ [0m[15;2H[91m[107m┃[0m[15;3H[34m[107m █ [0m[16;2H[91m[107m┃[0m[16;3H[34m[107m █ [0m[17;2H[91m[107m┃[0m[17;3H[34m[107m▄▀ [0m[18;2H[91m[107m┃[0m[18;3H[34m[107m█ [0m[19;2H[91m[107m┗━━━━━━━━━━━━━━━━━━━[0m[0m[24;1H[?25h
|
@@ -1 +1 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┏━━━━━┓[0m[2;1H[97m[40m┃ ┃[0m[3;1H[97m[40m
|
1
|
+
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┏━━━━━┓[0m[2;1H[97m[40m┃ ┃[0m[3;1H[97m[40m┃ ▄ ┃[0m[4;1H[97m[40m┗━━━━━┛[0m[2;2H[97m[40mEFGHI[0m[0m[24;1H[?25h
|
@@ -1 +1 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┏━━┓[0m[2;1H[97m[40m┃
|
1
|
+
[?25l[1;1H[J[1;1H[97m[40m [0m[2;1H[97m[40m [0m[3;1H[97m[40m [0m[4;1H[97m[40m [0m[5;1H[97m[40m [0m[6;1H[97m[40m [0m[7;1H[97m[40m [0m[8;1H[97m[40m [0m[9;1H[97m[40m [0m[10;1H[97m[40m [0m[11;1H[97m[40m [0m[12;1H[97m[40m [0m[13;1H[97m[40m [0m[14;1H[97m[40m [0m[15;1H[97m[40m [0m[16;1H[97m[40m [0m[17;1H[97m[40m [0m[18;1H[97m[40m [0m[19;1H[97m[40m [0m[20;1H[97m[40m [0m[21;1H[97m[40m [0m[22;1H[97m[40m [0m[23;1H[97m[40m [0m[24;1H[97m[40m [0m[1;1H[97m[40m┏━━┓[0m[2;1H[97m[40m┃ ┃[0m[3;1H[97m[40m┃ ▐┃[0m[4;1H[97m[40m┃ ┃[0m[5;1H[97m[40m┃ ┃[0m[6;1H[97m[40m┃ ┃[0m[7;1H[97m[40m┗━━┛[0m[2;2H[97m[40mE[0m[3;2H[97m[40mF[0m[4;2H[97m[40mG[0m[5;2H[97m[40mH[0m[6;2H[97m[40mI[0m[0m[24;1H[?25h
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whirled_peas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Collier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01
|
11
|
+
date: 2021-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -70,10 +70,18 @@ files:
|
|
70
70
|
- README.md
|
71
71
|
- Rakefile
|
72
72
|
- bin/console
|
73
|
-
- bin/easing
|
74
73
|
- bin/reset_cursor
|
75
74
|
- bin/screen_test
|
76
75
|
- bin/setup
|
76
|
+
- doc/application.md
|
77
|
+
- doc/cli.md
|
78
|
+
- doc/components.md
|
79
|
+
- doc/easing.md
|
80
|
+
- doc/elements.md
|
81
|
+
- doc/screen_test.md
|
82
|
+
- doc/settings.md
|
83
|
+
- doc/template_factory.md
|
84
|
+
- doc/themes.md
|
77
85
|
- examples/components.rb
|
78
86
|
- examples/graph.rb
|
79
87
|
- examples/intro.rb
|
@@ -122,7 +130,6 @@ files:
|
|
122
130
|
- lib/whirled_peas/graphics/graph_dimensions.rb
|
123
131
|
- lib/whirled_peas/graphics/graph_painter.rb
|
124
132
|
- lib/whirled_peas/graphics/grid_painter.rb
|
125
|
-
- lib/whirled_peas/graphics/mock_screen.rb
|
126
133
|
- lib/whirled_peas/graphics/painter.rb
|
127
134
|
- lib/whirled_peas/graphics/renderer.rb
|
128
135
|
- lib/whirled_peas/graphics/scrollbar_helper.rb
|
@@ -179,8 +186,14 @@ files:
|
|
179
186
|
- screen_test/components/list_with_active/t2b_separator.rb
|
180
187
|
- screen_test/elements/box.frame
|
181
188
|
- screen_test/elements/box.rb
|
182
|
-
- screen_test/elements/
|
183
|
-
- screen_test/elements/
|
189
|
+
- screen_test/elements/graph_asc.frame
|
190
|
+
- screen_test/elements/graph_asc.rb
|
191
|
+
- screen_test/elements/graph_desc.frame
|
192
|
+
- screen_test/elements/graph_desc.rb
|
193
|
+
- screen_test/elements/graph_horiz.frame
|
194
|
+
- screen_test/elements/graph_horiz.rb
|
195
|
+
- screen_test/elements/graph_sin.frame
|
196
|
+
- screen_test/elements/graph_sin.rb
|
184
197
|
- screen_test/elements/grid.frame
|
185
198
|
- screen_test/elements/grid.rb
|
186
199
|
- screen_test/elements/screen_overflow_x.frame
|
data/bin/easing
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require 'whirled_peas'
|
5
|
-
require 'whirled_peas/animator/easing'
|
6
|
-
|
7
|
-
module WhirledPeas
|
8
|
-
NUM_POINTS = 60
|
9
|
-
|
10
|
-
Animator::Easing::EASING.keys.each do |func|
|
11
|
-
Animator::Easing::EFFECTS.each do |effect|
|
12
|
-
easing = Animator::Easing.new(func, effect)
|
13
|
-
graph = Array.new(NUM_POINTS / ASPECT_RATIO) { '┃' }
|
14
|
-
NUM_POINTS.times.each do |i|
|
15
|
-
input = i.to_f / (NUM_POINTS - 1)
|
16
|
-
eased_value = ((easing.ease(input) * NUM_POINTS * 2) / ASPECT_RATIO).floor
|
17
|
-
graph.each.with_index do |row, row_num|
|
18
|
-
y_value = NUM_POINTS.to_f / ASPECT_RATIO - row_num - 1
|
19
|
-
row << if eased_value == 2 * y_value
|
20
|
-
'▄'
|
21
|
-
elsif eased_value == 2 * y_value + 1
|
22
|
-
'▀'
|
23
|
-
else
|
24
|
-
' '
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
graph << '┗' + '━' * NUM_POINTS
|
29
|
-
puts "#{func} (#{effect})"
|
30
|
-
puts graph.join("\n")
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require_relative 'renderer'
|
2
|
-
|
3
|
-
module WhirledPeas
|
4
|
-
module Graphics
|
5
|
-
class MockScreen
|
6
|
-
def initialize(width:, height:)
|
7
|
-
@width = width
|
8
|
-
@height = height
|
9
|
-
end
|
10
|
-
|
11
|
-
def paint(template)
|
12
|
-
Renderer.new(template, width, height).paint { }
|
13
|
-
end
|
14
|
-
|
15
|
-
def refresh
|
16
|
-
end
|
17
|
-
|
18
|
-
def finalize
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
attr_reader :width, :height
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|