sai 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Allen
|
8
|
+
autorequire:
|
8
9
|
bindir: bin
|
9
10
|
cert_chain: []
|
10
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-23 00:00:00.000000000 Z
|
11
12
|
dependencies: []
|
12
13
|
description: |-
|
13
14
|
Sai (彩) - meaning 'coloring' or 'paint' in Japanese - is a powerful and intuitive system for managing color output in command-line applications. Drawing inspiration from traditional Japanese artistic techniques, Sai brings vibrancy and harmony to terminal interfaces through its sophisticated color management.
|
@@ -37,14 +38,14 @@ files:
|
|
37
38
|
- lib/sai/conversion/rgb/color_transformer.rb
|
38
39
|
- lib/sai/decorator.rb
|
39
40
|
- lib/sai/decorator/color_manipulations.rb
|
40
|
-
- lib/sai/decorator/
|
41
|
+
- lib/sai/decorator/delegator.rb
|
41
42
|
- lib/sai/decorator/gradients.rb
|
42
43
|
- lib/sai/decorator/hex_colors.rb
|
43
44
|
- lib/sai/decorator/named_colors.rb
|
44
45
|
- lib/sai/decorator/named_styles.rb
|
45
46
|
- lib/sai/decorator/rgb_colors.rb
|
46
47
|
- lib/sai/mode_selector.rb
|
47
|
-
- lib/sai/
|
48
|
+
- lib/sai/registry.rb
|
48
49
|
- lib/sai/support.rb
|
49
50
|
- lib/sai/terminal/capabilities.rb
|
50
51
|
- lib/sai/terminal/color_mode.rb
|
@@ -63,14 +64,14 @@ files:
|
|
63
64
|
- sig/sai/conversion/rgb/color_transformer.rbs
|
64
65
|
- sig/sai/decorator.rbs
|
65
66
|
- sig/sai/decorator/color_manipulations.rbs
|
66
|
-
- sig/sai/decorator/
|
67
|
+
- sig/sai/decorator/delegator.rbs
|
67
68
|
- sig/sai/decorator/gradients.rbs
|
68
69
|
- sig/sai/decorator/hex_colors.rbs
|
69
70
|
- sig/sai/decorator/named_colors.rbs
|
70
71
|
- sig/sai/decorator/named_styles.rbs
|
71
72
|
- sig/sai/decorator/rgb_colors.rbs
|
72
73
|
- sig/sai/mode_selector.rbs
|
73
|
-
- sig/sai/
|
74
|
+
- sig/sai/registry.rbs
|
74
75
|
- sig/sai/support.rbs
|
75
76
|
- sig/sai/terminal/capabilities.rbs
|
76
77
|
- sig/sai/terminal/color_mode.rbs
|
@@ -79,10 +80,11 @@ licenses:
|
|
79
80
|
- MIT
|
80
81
|
metadata:
|
81
82
|
bug_tracker_uri: https://github.com/aaronmallen/sai/issues
|
82
|
-
changelog_uri: https://github.com/aaronmallen/sai/releases/tag/0.
|
83
|
+
changelog_uri: https://github.com/aaronmallen/sai/releases/tag/0.4.0
|
83
84
|
homepage_uri: https://github.com/aaronmallen/sai
|
84
85
|
rubygems_mfa_required: 'true'
|
85
|
-
source_code_uri: https://github.com/aaronmallen/sai/tree/0.
|
86
|
+
source_code_uri: https://github.com/aaronmallen/sai/tree/0.4.0
|
87
|
+
post_install_message:
|
86
88
|
rdoc_options: []
|
87
89
|
require_paths:
|
88
90
|
- lib
|
@@ -97,7 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
99
|
- !ruby/object:Gem::Version
|
98
100
|
version: '0'
|
99
101
|
requirements: []
|
100
|
-
rubygems_version: 3.
|
102
|
+
rubygems_version: 3.3.27
|
103
|
+
signing_key:
|
101
104
|
specification_version: 4
|
102
105
|
summary: An elegant color management system for crafting sophisticated CLI applications
|
103
106
|
test_files: []
|
@@ -1,84 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'sai/decorator'
|
4
|
-
require 'sai/decorator/color_manipulations'
|
5
|
-
require 'sai/decorator/gradients'
|
6
|
-
require 'sai/decorator/hex_colors'
|
7
|
-
require 'sai/decorator/named_colors'
|
8
|
-
require 'sai/decorator/named_styles'
|
9
|
-
require 'sai/decorator/rgb_colors'
|
10
|
-
|
11
|
-
module Sai
|
12
|
-
class Decorator
|
13
|
-
# Delegates all methods from the Decorator class and its component modules
|
14
|
-
#
|
15
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
16
|
-
# @since 0.3.1
|
17
|
-
#
|
18
|
-
# @api private
|
19
|
-
module Delegation
|
20
|
-
# The list of component modules to delegate methods from
|
21
|
-
#
|
22
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
23
|
-
# @since 0.3.1
|
24
|
-
#
|
25
|
-
# @api private
|
26
|
-
#
|
27
|
-
# @return [Array<Symbol>] the list of component modules
|
28
|
-
COMPONENT_MODULES = %i[
|
29
|
-
ColorManipulations
|
30
|
-
Gradients
|
31
|
-
HexColors
|
32
|
-
NamedColors
|
33
|
-
NamedStyles
|
34
|
-
RGBColors
|
35
|
-
].freeze #: Array[Symbol]
|
36
|
-
private_constant :COMPONENT_MODULES
|
37
|
-
|
38
|
-
class << self
|
39
|
-
# Install delegated methods on the given class or module
|
40
|
-
#
|
41
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
42
|
-
# @since 0.3.1
|
43
|
-
#
|
44
|
-
# @api private
|
45
|
-
#
|
46
|
-
# @param klass [Class, Module] the class or module to install the methods on
|
47
|
-
#
|
48
|
-
# @return [void]
|
49
|
-
# @rbs (Class | Module) -> void
|
50
|
-
def install(klass)
|
51
|
-
ignored_methods = %i[apply call decorate encode]
|
52
|
-
methods = collect_delegatable_methods.reject { |m| ignored_methods.include?(m) }
|
53
|
-
|
54
|
-
methods.each do |method|
|
55
|
-
klass.define_method(method) do |*args, **kwargs|
|
56
|
-
Decorator.new(mode: Sai.mode.auto).public_send(method, *args, **kwargs)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
private
|
62
|
-
|
63
|
-
# Collect all methods from the Decorator class and its component modules
|
64
|
-
#
|
65
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
66
|
-
# @since 0.3.1
|
67
|
-
#
|
68
|
-
# @api private
|
69
|
-
#
|
70
|
-
# @return [Array<Symbol>] the list of methods to delegate
|
71
|
-
# @rbs () -> Array[Symbol]
|
72
|
-
def collect_delegatable_methods
|
73
|
-
methods = Decorator.instance_methods(false)
|
74
|
-
|
75
|
-
COMPONENT_MODULES.each do |mod|
|
76
|
-
methods.concat(Decorator.const_get(mod).instance_methods(false))
|
77
|
-
end
|
78
|
-
|
79
|
-
methods.uniq
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
data/lib/sai/named_colors.rb
DELETED
@@ -1,437 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Sai
|
4
|
-
# A collection of named colors and their RGB values
|
5
|
-
#
|
6
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
7
|
-
# @since 0.3.1
|
8
|
-
#
|
9
|
-
# @api private
|
10
|
-
module NamedColors
|
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
|
-
ANSI = {
|
20
|
-
black: [0, 0, 0],
|
21
|
-
red: [205, 0, 0],
|
22
|
-
green: [0, 205, 0],
|
23
|
-
yellow: [205, 205, 0],
|
24
|
-
blue: [0, 0, 238],
|
25
|
-
magenta: [205, 0, 205],
|
26
|
-
cyan: [0, 205, 205],
|
27
|
-
white: [229, 229, 229],
|
28
|
-
bright_black: [127, 127, 127],
|
29
|
-
bright_red: [255, 0, 0],
|
30
|
-
bright_green: [0, 255, 0],
|
31
|
-
bright_yellow: [255, 255, 0],
|
32
|
-
bright_blue: [92, 92, 255],
|
33
|
-
bright_magenta: [255, 0, 255],
|
34
|
-
bright_cyan: [0, 255, 255],
|
35
|
-
bright_white: [255, 255, 255]
|
36
|
-
}.freeze # Hash[Symbol, Array[Integer]]
|
37
|
-
|
38
|
-
# CSS color names and their RGB values
|
39
|
-
#
|
40
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
41
|
-
# @since 0.3.1
|
42
|
-
#
|
43
|
-
# @api private
|
44
|
-
#
|
45
|
-
# @return [Hash{Symbol => Array<Integer>}] the color names and RGB values
|
46
|
-
CSS = {
|
47
|
-
alice_blue: [240, 248, 255],
|
48
|
-
antique_white: [250, 235, 215],
|
49
|
-
aqua: [0, 255, 255],
|
50
|
-
aquamarine: [127, 255, 212],
|
51
|
-
azure: [240, 255, 255],
|
52
|
-
beige: [245, 245, 220],
|
53
|
-
bisque: [255, 228, 196],
|
54
|
-
blanched_almond: [255, 235, 205],
|
55
|
-
brown: [165, 42, 42],
|
56
|
-
burly_wood: [222, 184, 135],
|
57
|
-
chartreuse: [127, 255, 0],
|
58
|
-
chocolate: [210, 105, 30],
|
59
|
-
coral: [255, 127, 80],
|
60
|
-
cornsilk: [255, 248, 220],
|
61
|
-
crimson: [220, 20, 60],
|
62
|
-
dark_gray: [169, 169, 169],
|
63
|
-
dark_olive_green: [85, 107, 47],
|
64
|
-
dark_orchid: [153, 50, 204],
|
65
|
-
dark_salmon: [233, 150, 122],
|
66
|
-
dark_slate_blue: [72, 61, 139],
|
67
|
-
dark_slate_gray: [47, 79, 79],
|
68
|
-
deep_pink: [255, 20, 147],
|
69
|
-
deep_sky_blue: [0, 191, 255],
|
70
|
-
dim_gray: [105, 105, 105],
|
71
|
-
dodger_blue: [30, 144, 255],
|
72
|
-
firebrick: [178, 34, 34],
|
73
|
-
floral_white: [255, 250, 240],
|
74
|
-
forest_green: [34, 139, 34],
|
75
|
-
fuchsia: [255, 0, 255],
|
76
|
-
gainsboro: [220, 220, 220],
|
77
|
-
ghost_white: [248, 248, 255],
|
78
|
-
gold: [255, 215, 0],
|
79
|
-
goldenrod: [218, 165, 32],
|
80
|
-
gray: [128, 128, 128],
|
81
|
-
honeydew: [240, 255, 240],
|
82
|
-
indigo: [75, 0, 130],
|
83
|
-
ivory: [255, 255, 240],
|
84
|
-
khaki: [240, 230, 140],
|
85
|
-
lavender: [230, 230, 250],
|
86
|
-
lavender_blush: [255, 240, 245],
|
87
|
-
lawn_green: [124, 252, 0],
|
88
|
-
lemon_chiffon: [255, 250, 205],
|
89
|
-
light_blue: [173, 216, 230],
|
90
|
-
light_cyan: [224, 255, 255],
|
91
|
-
light_goldenrod_yellow: [250, 250, 210],
|
92
|
-
light_gray: [211, 211, 211],
|
93
|
-
light_pink: [255, 182, 193],
|
94
|
-
light_salmon: [255, 160, 122],
|
95
|
-
light_sea_green: [32, 178, 170],
|
96
|
-
light_sky_blue: [135, 206, 250],
|
97
|
-
light_slate_gray: [119, 136, 153],
|
98
|
-
light_yellow: [255, 255, 224],
|
99
|
-
lime: [0, 255, 0],
|
100
|
-
lime_green: [50, 205, 50],
|
101
|
-
linen: [250, 240, 230],
|
102
|
-
maroon: [128, 0, 0],
|
103
|
-
medium_aquamarine: [102, 205, 170],
|
104
|
-
medium_blue: [0, 0, 205],
|
105
|
-
medium_sea_green: [60, 179, 113],
|
106
|
-
medium_slate_blue: [123, 104, 238],
|
107
|
-
midnight_blue: [25, 25, 112],
|
108
|
-
mint_cream: [245, 255, 250],
|
109
|
-
misty_rose: [255, 228, 225],
|
110
|
-
moccasin: [255, 228, 181],
|
111
|
-
navajo_white: [255, 222, 173],
|
112
|
-
navy: [0, 0, 128],
|
113
|
-
old_lace: [253, 245, 230],
|
114
|
-
olive: [128, 128, 0],
|
115
|
-
olive_drab: [107, 142, 35],
|
116
|
-
orange: [255, 165, 0],
|
117
|
-
orange_red: [255, 69, 0],
|
118
|
-
pale_goldenrod: [238, 232, 170],
|
119
|
-
pale_green: [152, 251, 152],
|
120
|
-
pale_turquoise: [175, 238, 238],
|
121
|
-
pale_violet_red: [219, 112, 147],
|
122
|
-
papaya_whip: [255, 239, 213],
|
123
|
-
peach_puff: [255, 218, 185],
|
124
|
-
peru: [205, 133, 63],
|
125
|
-
pink: [255, 192, 203],
|
126
|
-
plum: [221, 160, 221],
|
127
|
-
powder_blue: [176, 224, 230],
|
128
|
-
royal_blue: [65, 105, 225],
|
129
|
-
saddle_brown: [139, 69, 19],
|
130
|
-
salmon: [250, 128, 114],
|
131
|
-
sea_green: [46, 139, 87],
|
132
|
-
sea_shell: [255, 245, 238],
|
133
|
-
sienna: [160, 82, 45],
|
134
|
-
silver: [192, 192, 192],
|
135
|
-
sky_blue: [135, 206, 235],
|
136
|
-
slate_blue: [106, 90, 205],
|
137
|
-
slate_gray: [112, 128, 144],
|
138
|
-
snow: [255, 250, 250],
|
139
|
-
spring_green: [0, 255, 127],
|
140
|
-
teal: [0, 128, 128],
|
141
|
-
thistle: [216, 191, 216],
|
142
|
-
tomato: [255, 99, 71],
|
143
|
-
turquoise: [64, 224, 208],
|
144
|
-
wheat: [245, 222, 179],
|
145
|
-
white_smoke: [245, 245, 245],
|
146
|
-
yellow_green: [154, 205, 50]
|
147
|
-
}.freeze #: Hash[Symbol, Array[Integer]]
|
148
|
-
|
149
|
-
# XTERM color names and their RGB values
|
150
|
-
#
|
151
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
152
|
-
# @since 0.3.1
|
153
|
-
#
|
154
|
-
# @api private
|
155
|
-
#
|
156
|
-
# @return [Hash{Symbol => Array<Integer>}] the color names and RGB values
|
157
|
-
# rubocop:disable Naming/VariableNumber
|
158
|
-
XTERM = {
|
159
|
-
aqua_system: [0, 255, 255],
|
160
|
-
aquamarine1: [95, 255, 215],
|
161
|
-
aquamarine1_122: [135, 255, 215],
|
162
|
-
aquamarine3: [95, 215, 175],
|
163
|
-
black_system: [0, 0, 0],
|
164
|
-
blue1: [0, 0, 255],
|
165
|
-
blue_system: [0, 0, 255],
|
166
|
-
blue_violet: [95, 0, 255],
|
167
|
-
blue3: [0, 0, 175],
|
168
|
-
blue3_20: [0, 0, 215],
|
169
|
-
cadet_blue: [95, 175, 135],
|
170
|
-
cadet_blue_73: [95, 175, 175],
|
171
|
-
chartreuse1: [135, 255, 0],
|
172
|
-
chartreuse2: [95, 255, 0],
|
173
|
-
chartreuse2_112: [135, 215, 0],
|
174
|
-
chartreuse3: [95, 175, 0],
|
175
|
-
chartreuse3_76: [95, 215, 0],
|
176
|
-
chartreuse4: [95, 135, 0],
|
177
|
-
cornflower_blue: [95, 135, 255],
|
178
|
-
cornsilk1: [255, 255, 215],
|
179
|
-
cyan1: [0, 255, 255],
|
180
|
-
cyan2: [0, 255, 215],
|
181
|
-
cyan3: [0, 215, 175],
|
182
|
-
dark_blue: [0, 0, 135],
|
183
|
-
dark_cyan: [0, 175, 135],
|
184
|
-
dark_goldenrod: [175, 135, 0],
|
185
|
-
dark_green: [0, 95, 0],
|
186
|
-
dark_khaki: [175, 175, 95],
|
187
|
-
dark_magenta: [135, 0, 135],
|
188
|
-
dark_magenta_91: [135, 0, 175],
|
189
|
-
dark_olive_green1: [215, 255, 95],
|
190
|
-
dark_olive_green1_192: [215, 255, 135],
|
191
|
-
dark_olive_green2: [175, 255, 95],
|
192
|
-
dark_olive_green3: [135, 175, 95],
|
193
|
-
dark_olive_green3_113: [135, 215, 95],
|
194
|
-
dark_olive_green3_149: [175, 215, 95],
|
195
|
-
dark_orange: [255, 135, 0],
|
196
|
-
dark_orange3: [175, 95, 0],
|
197
|
-
dark_orange3_166: [215, 95, 0],
|
198
|
-
dark_red: [95, 0, 0],
|
199
|
-
dark_red_88: [135, 0, 0],
|
200
|
-
dark_sea_green: [135, 175, 135],
|
201
|
-
dark_sea_green1: [175, 255, 215],
|
202
|
-
dark_sea_green1_193: [215, 255, 175],
|
203
|
-
dark_sea_green2: [175, 215, 175],
|
204
|
-
dark_sea_green2_157: [175, 255, 175],
|
205
|
-
dark_sea_green3: [135, 215, 175],
|
206
|
-
dark_sea_green3_150: [175, 215, 135],
|
207
|
-
dark_sea_green4: [95, 135, 95],
|
208
|
-
dark_sea_green4_71: [95, 175, 95],
|
209
|
-
dark_slate_gray1: [135, 255, 255],
|
210
|
-
dark_slate_gray2: [95, 255, 255],
|
211
|
-
dark_slate_gray3: [135, 215, 215],
|
212
|
-
dark_turquoise: [0, 215, 215],
|
213
|
-
dark_violet: [135, 0, 215],
|
214
|
-
dark_violet_128: [175, 0, 215],
|
215
|
-
deep_pink1: [255, 0, 135],
|
216
|
-
deep_pink1_199: [255, 0, 175],
|
217
|
-
deep_pink2: [255, 0, 95],
|
218
|
-
deep_pink3: [215, 0, 95],
|
219
|
-
deep_pink3_162: [215, 0, 135],
|
220
|
-
deep_pink4: [95, 0, 95],
|
221
|
-
deep_pink4_89: [135, 0, 95],
|
222
|
-
deep_pink4_125: [175, 0, 95],
|
223
|
-
deep_sky_blue1: [0, 175, 255],
|
224
|
-
deep_sky_blue2: [0, 175, 215],
|
225
|
-
deep_sky_blue3: [0, 135, 175],
|
226
|
-
deep_sky_blue3_32: [0, 135, 215],
|
227
|
-
deep_sky_blue4: [0, 95, 95],
|
228
|
-
deep_sky_blue4_24: [0, 95, 135],
|
229
|
-
deep_sky_blue4_25: [0, 95, 175],
|
230
|
-
dodger_blue1: [0, 135, 255],
|
231
|
-
dodger_blue2: [0, 95, 255],
|
232
|
-
dodger_blue3: [0, 95, 215],
|
233
|
-
fuchsia_system: [255, 0, 255],
|
234
|
-
gold1: [255, 215, 0],
|
235
|
-
gold3: [175, 175, 0],
|
236
|
-
gold3_178: [215, 175, 0],
|
237
|
-
green1: [0, 255, 0],
|
238
|
-
green3: [0, 175, 0],
|
239
|
-
green3_40: [0, 215, 0],
|
240
|
-
green4: [0, 135, 0],
|
241
|
-
green_system: [0, 128, 0],
|
242
|
-
green_yellow: [175, 255, 0],
|
243
|
-
grey0: [0, 0, 0],
|
244
|
-
grey100: [255, 255, 255],
|
245
|
-
grey11: [28, 28, 28],
|
246
|
-
grey15: [38, 38, 38],
|
247
|
-
grey19: [48, 48, 48],
|
248
|
-
grey23: [58, 58, 58],
|
249
|
-
grey27: [68, 68, 68],
|
250
|
-
grey3: [8, 8, 8],
|
251
|
-
grey30: [78, 78, 78],
|
252
|
-
grey35: [88, 88, 88],
|
253
|
-
grey37: [95, 95, 95],
|
254
|
-
grey39: [98, 98, 98],
|
255
|
-
grey42: [108, 108, 108],
|
256
|
-
grey46: [118, 118, 118],
|
257
|
-
grey50: [128, 128, 128],
|
258
|
-
grey53: [135, 135, 135],
|
259
|
-
grey54: [138, 138, 138],
|
260
|
-
grey58: [148, 148, 148],
|
261
|
-
grey62: [158, 158, 158],
|
262
|
-
grey66: [168, 168, 168],
|
263
|
-
grey7: [18, 18, 18],
|
264
|
-
grey70: [178, 178, 178],
|
265
|
-
grey74: [188, 188, 188],
|
266
|
-
grey78: [198, 198, 198],
|
267
|
-
grey82: [208, 208, 208],
|
268
|
-
grey84: [215, 215, 215],
|
269
|
-
grey85: [218, 218, 218],
|
270
|
-
grey89: [228, 228, 228],
|
271
|
-
grey93: [238, 238, 238],
|
272
|
-
grey_system: [128, 128, 128],
|
273
|
-
honeydew2: [215, 255, 215],
|
274
|
-
hot_pink: [255, 95, 175],
|
275
|
-
hot_pink_206: [255, 95, 215],
|
276
|
-
hot_pink2: [215, 95, 175],
|
277
|
-
hot_pink3: [175, 95, 135],
|
278
|
-
hot_pink3_168: [215, 95, 135],
|
279
|
-
indian_red: [175, 95, 95],
|
280
|
-
indian_red_167: [215, 95, 95],
|
281
|
-
indian_red1: [255, 95, 95],
|
282
|
-
indian_red1_204: [255, 95, 135],
|
283
|
-
khaki1: [255, 255, 135],
|
284
|
-
khaki3: [215, 215, 95],
|
285
|
-
light_coral: [255, 135, 135],
|
286
|
-
light_cyan1: [215, 255, 255],
|
287
|
-
light_cyan3: [175, 215, 215],
|
288
|
-
light_goldenrod1: [255, 255, 95],
|
289
|
-
light_goldenrod2: [255, 215, 135],
|
290
|
-
light_goldenrod2_221: [255, 215, 95],
|
291
|
-
light_goldenrod3: [215, 175, 95],
|
292
|
-
light_green: [135, 255, 95],
|
293
|
-
light_green_120: [135, 255, 135],
|
294
|
-
light_pink1: [255, 175, 175],
|
295
|
-
light_pink3: [215, 135, 135],
|
296
|
-
light_pink4: [135, 95, 95],
|
297
|
-
light_salmon1: [255, 175, 135],
|
298
|
-
light_salmon3: [175, 135, 95],
|
299
|
-
light_salmon3_173: [215, 135, 95],
|
300
|
-
light_sky_blue1: [175, 215, 255],
|
301
|
-
light_sky_blue3: [135, 175, 175],
|
302
|
-
light_sky_blue3_110: [135, 175, 215],
|
303
|
-
light_slate_blue: [135, 135, 255],
|
304
|
-
light_slate_grey: [135, 135, 175],
|
305
|
-
light_steel_blue: [175, 175, 255],
|
306
|
-
light_steel_blue1: [215, 215, 255],
|
307
|
-
light_steel_blue3: [175, 175, 215],
|
308
|
-
lime_system: [0, 255, 0],
|
309
|
-
magenta1: [255, 0, 255],
|
310
|
-
magenta2: [215, 0, 255],
|
311
|
-
magenta2_200: [255, 0, 215],
|
312
|
-
magenta3: [175, 0, 175],
|
313
|
-
magenta3_163: [215, 0, 175],
|
314
|
-
magenta3_164: [215, 0, 215],
|
315
|
-
maroon_system: [128, 0, 0],
|
316
|
-
medium_orchid: [175, 95, 215],
|
317
|
-
medium_orchid1: [215, 95, 255],
|
318
|
-
medium_orchid1_207: [255, 95, 255],
|
319
|
-
medium_orchid3: [175, 95, 175],
|
320
|
-
medium_purple: [135, 135, 215],
|
321
|
-
medium_purple1: [175, 135, 255],
|
322
|
-
medium_purple2: [175, 95, 255],
|
323
|
-
medium_purple2_140: [175, 135, 215],
|
324
|
-
medium_purple3: [135, 95, 175],
|
325
|
-
medium_purple3_98: [135, 95, 215],
|
326
|
-
medium_purple4: [95, 95, 135],
|
327
|
-
medium_spring_green: [0, 255, 175],
|
328
|
-
medium_turquoise: [95, 215, 215],
|
329
|
-
medium_violet_red: [175, 0, 135],
|
330
|
-
misty_rose1: [255, 215, 215],
|
331
|
-
misty_rose3: [215, 175, 175],
|
332
|
-
navy_blue: [0, 0, 95],
|
333
|
-
navy_system: [0, 0, 128],
|
334
|
-
navajo_white1: [255, 215, 175],
|
335
|
-
navajo_white3: [175, 175, 135],
|
336
|
-
olive_system: [128, 128, 0],
|
337
|
-
orange1: [255, 175, 0],
|
338
|
-
orange3: [215, 135, 0],
|
339
|
-
orange4: [95, 95, 0],
|
340
|
-
orange4_94: [135, 95, 0],
|
341
|
-
orange_red1: [255, 95, 0],
|
342
|
-
orchid: [215, 95, 215],
|
343
|
-
orchid1: [255, 135, 255],
|
344
|
-
orchid2: [255, 135, 215],
|
345
|
-
pale_green1: [135, 255, 175],
|
346
|
-
pale_green1_156: [175, 255, 135],
|
347
|
-
pale_green3: [95, 215, 95],
|
348
|
-
pale_green3_114: [135, 215, 135],
|
349
|
-
pale_turquoise1: [175, 255, 255],
|
350
|
-
pale_turquoise4: [95, 135, 135],
|
351
|
-
pale_violet_red1: [255, 135, 175],
|
352
|
-
pink1: [255, 175, 215],
|
353
|
-
pink3: [215, 135, 175],
|
354
|
-
plum1: [255, 175, 255],
|
355
|
-
plum2: [215, 175, 255],
|
356
|
-
plum3: [215, 135, 215],
|
357
|
-
plum4: [135, 95, 135],
|
358
|
-
purple: [135, 0, 255],
|
359
|
-
purple_129: [175, 0, 255],
|
360
|
-
purple3: [95, 0, 215],
|
361
|
-
purple4: [95, 0, 135],
|
362
|
-
purple4_55: [95, 0, 175],
|
363
|
-
purple_system: [128, 0, 128],
|
364
|
-
red1: [255, 0, 0],
|
365
|
-
red3: [175, 0, 0],
|
366
|
-
red3_160: [215, 0, 0],
|
367
|
-
red_system: [255, 0, 0],
|
368
|
-
rosy_brown: [175, 135, 135],
|
369
|
-
royal_blue1: [95, 95, 255],
|
370
|
-
salmon1: [255, 135, 95],
|
371
|
-
sandy_brown: [255, 175, 95],
|
372
|
-
silver_system: [192, 192, 192],
|
373
|
-
sky_blue1: [135, 215, 255],
|
374
|
-
sky_blue2: [135, 175, 255],
|
375
|
-
sky_blue3: [95, 175, 215],
|
376
|
-
slate_blue1: [135, 95, 255],
|
377
|
-
slate_blue3: [95, 95, 175],
|
378
|
-
slate_blue3_62: [95, 95, 215],
|
379
|
-
spring_green1: [0, 255, 135],
|
380
|
-
spring_green2: [0, 215, 135],
|
381
|
-
spring_green2_47: [0, 255, 95],
|
382
|
-
spring_green3: [0, 175, 95],
|
383
|
-
spring_green3_41: [0, 215, 95],
|
384
|
-
spring_green4: [0, 135, 95],
|
385
|
-
steel_blue: [95, 135, 175],
|
386
|
-
steel_blue1: [95, 175, 255],
|
387
|
-
steel_blue1_81: [95, 215, 255],
|
388
|
-
steel_blue3: [95, 135, 215],
|
389
|
-
tan: [215, 175, 135],
|
390
|
-
teal_system: [0, 128, 128],
|
391
|
-
thistle1: [255, 215, 255],
|
392
|
-
thistle3: [215, 175, 215],
|
393
|
-
turquoise2: [0, 215, 255],
|
394
|
-
turquoise4: [0, 135, 135],
|
395
|
-
violet: [215, 135, 255],
|
396
|
-
wheat1: [255, 255, 175],
|
397
|
-
wheat4: [135, 135, 95],
|
398
|
-
white_system: [255, 255, 255],
|
399
|
-
yellow1: [255, 255, 0],
|
400
|
-
yellow2: [215, 255, 0],
|
401
|
-
yellow3: [175, 215, 0],
|
402
|
-
yellow3_184: [215, 215, 0],
|
403
|
-
yellow4: [135, 135, 0],
|
404
|
-
yellow4_106: [135, 175, 0],
|
405
|
-
yellow_system: [255, 255, 0]
|
406
|
-
}.freeze #: Hash[Symbol, Array[Integer]]
|
407
|
-
# rubocop:enable Naming/VariableNumber
|
408
|
-
|
409
|
-
# Look up an RGB value by color name
|
410
|
-
#
|
411
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
412
|
-
# @since 0.3.1
|
413
|
-
#
|
414
|
-
# @api private
|
415
|
-
#
|
416
|
-
# @param name [String, Symbol] the color name
|
417
|
-
#
|
418
|
-
# @return [Array<Integer>] the RGB value
|
419
|
-
# @rbs (String | Symbol name) -> Array[Integer]?
|
420
|
-
def self.[](name)
|
421
|
-
key = name.to_sym
|
422
|
-
ANSI.fetch(key, XTERM.fetch(key, CSS.fetch(key, nil)))
|
423
|
-
end
|
424
|
-
|
425
|
-
# Get a list of all color names
|
426
|
-
#
|
427
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
428
|
-
# @since 0.3.1
|
429
|
-
#
|
430
|
-
# @api private
|
431
|
-
#
|
432
|
-
# @return [Array<Symbol>] the color names
|
433
|
-
def self.names
|
434
|
-
(ANSI.keys + CSS.keys + XTERM.keys).uniq.sort
|
435
|
-
end
|
436
|
-
end
|
437
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# Generated from lib/sai/decorator/delegation.rb with RBS::Inline
|
2
|
-
|
3
|
-
module Sai
|
4
|
-
class Decorator
|
5
|
-
# Delegates all methods from the Decorator class and its component modules
|
6
|
-
#
|
7
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
8
|
-
# @since 0.3.1
|
9
|
-
#
|
10
|
-
# @api private
|
11
|
-
module Delegation
|
12
|
-
# The list of component modules to delegate methods from
|
13
|
-
#
|
14
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
15
|
-
# @since 0.3.1
|
16
|
-
#
|
17
|
-
# @api private
|
18
|
-
#
|
19
|
-
# @return [Array<Symbol>] the list of component modules
|
20
|
-
COMPONENT_MODULES: Array[Symbol]
|
21
|
-
|
22
|
-
# Install delegated methods on the given class or module
|
23
|
-
#
|
24
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
25
|
-
# @since 0.3.1
|
26
|
-
#
|
27
|
-
# @api private
|
28
|
-
#
|
29
|
-
# @param klass [Class, Module] the class or module to install the methods on
|
30
|
-
#
|
31
|
-
# @return [void]
|
32
|
-
# @rbs (Class | Module) -> void
|
33
|
-
def self.install: (Class | Module) -> void
|
34
|
-
|
35
|
-
# Collect all methods from the Decorator class and its component modules
|
36
|
-
#
|
37
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
38
|
-
# @since 0.3.1
|
39
|
-
#
|
40
|
-
# @api private
|
41
|
-
#
|
42
|
-
# @return [Array<Symbol>] the list of methods to delegate
|
43
|
-
# @rbs () -> Array[Symbol]
|
44
|
-
private def self.collect_delegatable_methods: () -> Array[Symbol]
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
data/sig/sai/named_colors.rbs
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
# Generated from lib/sai/named_colors.rb with RBS::Inline
|
2
|
-
|
3
|
-
module Sai
|
4
|
-
# A collection of named colors and their RGB values
|
5
|
-
#
|
6
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
7
|
-
# @since 0.3.1
|
8
|
-
#
|
9
|
-
# @api private
|
10
|
-
module NamedColors
|
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
|
-
ANSI: untyped
|
20
|
-
|
21
|
-
# CSS color names and their RGB values
|
22
|
-
#
|
23
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
24
|
-
# @since 0.3.1
|
25
|
-
#
|
26
|
-
# @api private
|
27
|
-
#
|
28
|
-
# @return [Hash{Symbol => Array<Integer>}] the color names and RGB values
|
29
|
-
CSS: Hash[Symbol, Array[Integer]]
|
30
|
-
|
31
|
-
# XTERM color names and their RGB values
|
32
|
-
#
|
33
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
34
|
-
# @since 0.3.1
|
35
|
-
#
|
36
|
-
# @api private
|
37
|
-
#
|
38
|
-
# @return [Hash{Symbol => Array<Integer>}] the color names and RGB values
|
39
|
-
# rubocop:disable Naming/VariableNumber
|
40
|
-
XTERM: Hash[Symbol, Array[Integer]]
|
41
|
-
|
42
|
-
# Look up an RGB value by color name
|
43
|
-
#
|
44
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
45
|
-
# @since 0.3.1
|
46
|
-
#
|
47
|
-
# @api private
|
48
|
-
#
|
49
|
-
# @param name [String, Symbol] the color name
|
50
|
-
#
|
51
|
-
# @return [Array<Integer>] the RGB value
|
52
|
-
# @rbs (String | Symbol name) -> Array[Integer]?
|
53
|
-
def self.[]: (String | Symbol name) -> Array[Integer]?
|
54
|
-
|
55
|
-
# Get a list of all color names
|
56
|
-
#
|
57
|
-
# @author {https://aaronmallen.me Aaron Allen}
|
58
|
-
# @since 0.3.1
|
59
|
-
#
|
60
|
-
# @api private
|
61
|
-
#
|
62
|
-
# @return [Array<Symbol>] the color names
|
63
|
-
def self.names: () -> untyped
|
64
|
-
end
|
65
|
-
end
|