sai 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -1
- data/README.md +25 -4
- data/docs/USAGE.md +21 -14
- data/lib/sai/ansi.rb +40 -0
- data/lib/sai/conversion/rgb/color_space.rb +2 -2
- data/lib/sai/decorator/delegator.rb +79 -0
- data/lib/sai/decorator/named_colors.rb +44 -738
- data/lib/sai/decorator.rb +2 -3
- data/lib/sai/registry.rb +134 -0
- data/lib/sai.rb +49 -764
- data/sig/sai/ansi.rbs +21 -0
- data/sig/sai/decorator/delegator.rbs +95 -0
- data/sig/sai/decorator/named_colors.rbs +36 -1453
- data/sig/sai/decorator.rbs +2 -3
- data/sig/sai/registry.rbs +106 -0
- data/sig/sai.rbs +34 -1519
- metadata +12 -9
- data/lib/sai/decorator/delegation.rb +0 -84
- data/lib/sai/named_colors.rb +0 -437
- data/sig/sai/decorator/delegation.rbs +0 -47
- data/sig/sai/named_colors.rbs +0 -65
data/sig/sai/ansi.rbs
CHANGED
@@ -8,6 +8,16 @@ module Sai
|
|
8
8
|
#
|
9
9
|
# @api private
|
10
10
|
module ANSI
|
11
|
+
# Standard ANSI color names and their RGB values
|
12
|
+
#
|
13
|
+
# @author {https://aaronmallen.me Aaron Allen}
|
14
|
+
# @since 0.3.1
|
15
|
+
#
|
16
|
+
# @api private
|
17
|
+
#
|
18
|
+
# @return [Hash{Symbol => Array<Integer>}] the color names and RGB values
|
19
|
+
COLORS: untyped
|
20
|
+
|
11
21
|
# ANSI color code mappings
|
12
22
|
#
|
13
23
|
# @author {https://aaronmallen.me Aaron Allen}
|
@@ -37,5 +47,16 @@ module Sai
|
|
37
47
|
#
|
38
48
|
# @return [Hash{Symbol => Integer}] the style codes
|
39
49
|
STYLES: untyped
|
50
|
+
|
51
|
+
# Install the ANSI colors
|
52
|
+
#
|
53
|
+
# @author {https://aaronmallen.me Aaron Allen}
|
54
|
+
# @since 0.4.0
|
55
|
+
#
|
56
|
+
# @api private
|
57
|
+
#
|
58
|
+
# @return [void]
|
59
|
+
# @rbs () -> void
|
60
|
+
def self.install: () -> void
|
40
61
|
end
|
41
62
|
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# Generated from lib/sai/decorator/delegator.rb with RBS::Inline
|
2
|
+
|
3
|
+
module Sai
|
4
|
+
class Decorator
|
5
|
+
# Provides method delegation to the {Decorator} class for classes or modules that include it
|
6
|
+
#
|
7
|
+
# @author {https://aaronmallen.me Aaron Allen}
|
8
|
+
# @since 0.4.0
|
9
|
+
#
|
10
|
+
# @abstract Include in a class or module to provide method delegation to the {Decorator} class
|
11
|
+
# @api private
|
12
|
+
module Delegator
|
13
|
+
def blink: () -> Decorator
|
14
|
+
|
15
|
+
def bold: () -> Decorator
|
16
|
+
|
17
|
+
def conceal: () -> Decorator
|
18
|
+
|
19
|
+
def darken_background: () -> Decorator
|
20
|
+
|
21
|
+
def darken_bg: () -> Decorator
|
22
|
+
|
23
|
+
def darken_fg: () -> Decorator
|
24
|
+
|
25
|
+
def darken_foreground: () -> Decorator
|
26
|
+
|
27
|
+
def darken_text: () -> Decorator
|
28
|
+
|
29
|
+
def dim: () -> Decorator
|
30
|
+
|
31
|
+
def gradient: () -> Decorator
|
32
|
+
|
33
|
+
def hex: () -> Decorator
|
34
|
+
|
35
|
+
def italic: () -> Decorator
|
36
|
+
|
37
|
+
def lighten_background: () -> Decorator
|
38
|
+
|
39
|
+
def lighten_bg: () -> Decorator
|
40
|
+
|
41
|
+
def lighten_fg: () -> Decorator
|
42
|
+
|
43
|
+
def lighten_foreground: () -> Decorator
|
44
|
+
|
45
|
+
def lighten_text: () -> Decorator
|
46
|
+
|
47
|
+
def no_blink: () -> Decorator
|
48
|
+
|
49
|
+
def no_conceal: () -> Decorator
|
50
|
+
|
51
|
+
def no_italic: () -> Decorator
|
52
|
+
|
53
|
+
def no_reverse: () -> Decorator
|
54
|
+
|
55
|
+
def no_strike: () -> Decorator
|
56
|
+
|
57
|
+
def no_underline: () -> Decorator
|
58
|
+
|
59
|
+
def normal_intensity: () -> Decorator
|
60
|
+
|
61
|
+
def on_gradient: () -> Decorator
|
62
|
+
|
63
|
+
def on_hex: () -> Decorator
|
64
|
+
|
65
|
+
def on_rainbow: () -> Decorator
|
66
|
+
|
67
|
+
def on_rgb: () -> Decorator
|
68
|
+
|
69
|
+
def rainbow: () -> Decorator
|
70
|
+
|
71
|
+
def rapid_blink: () -> Decorator
|
72
|
+
|
73
|
+
def reverse: () -> Decorator
|
74
|
+
|
75
|
+
def rgb: () -> Decorator
|
76
|
+
|
77
|
+
def strike: () -> Decorator
|
78
|
+
|
79
|
+
def underline: () -> Decorator
|
80
|
+
|
81
|
+
# Apply a specific color mode to the {Decorator} instance
|
82
|
+
#
|
83
|
+
# @author {https://aaronmallen.me Aaron Allen}
|
84
|
+
# @since 0.4.0
|
85
|
+
#
|
86
|
+
# @api private
|
87
|
+
#
|
88
|
+
# @param mode [Integer] the color mode to use
|
89
|
+
#
|
90
|
+
# @return [Decorator] a new instance of Decorator with the applied color mode
|
91
|
+
# @rbs (Integer mode) -> Decorator
|
92
|
+
def with_mode: (Integer mode) -> Decorator
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|