shoes-core 4.0.0.pre4 → 4.0.0.pre5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Guardfile +5 -0
- data/bin/shoes +1 -1
- data/bin/shoes-stub +1 -1
- data/ext/install/Rakefile +15 -5
- data/ext/install/shoes.bat +1 -1
- data/lib/shoes/animation.rb +2 -2
- data/lib/shoes/arc.rb +1 -0
- data/lib/shoes/builtin_methods.rb +5 -18
- data/lib/shoes/button.rb +1 -5
- data/lib/shoes/check_button.rb +1 -5
- data/lib/shoes/color.rb +5 -274
- data/lib/shoes/color/dsl.rb +166 -0
- data/lib/shoes/color/dsl_helpers.rb +84 -0
- data/lib/shoes/color/hex_converter.rb +32 -0
- data/lib/shoes/common/background_element.rb +5 -0
- data/lib/shoes/common/hover.rb +87 -0
- data/lib/shoes/common/initialization.rb +21 -8
- data/lib/shoes/common/remove.rb +2 -0
- data/lib/shoes/common/state.rb +17 -3
- data/lib/shoes/common/style.rb +8 -0
- data/lib/shoes/configuration.rb +18 -15
- data/lib/shoes/core/version.rb +1 -1
- data/lib/shoes/dimension.rb +6 -19
- data/lib/shoes/dimensions.rb +8 -0
- data/lib/shoes/download.rb +5 -3
- data/lib/shoes/dsl.rb +3 -3
- data/lib/shoes/image.rb +1 -0
- data/lib/shoes/image_pattern.rb +1 -1
- data/lib/shoes/input_box.rb +2 -5
- data/lib/shoes/internal_app.rb +13 -2
- data/lib/shoes/line.rb +1 -0
- data/lib/shoes/link.rb +8 -0
- data/lib/shoes/list_box.rb +2 -5
- data/lib/shoes/mock/check.rb +3 -0
- data/lib/shoes/mock/image.rb +6 -0
- data/lib/shoes/mock/progress.rb +6 -0
- data/lib/shoes/mock/radio.rb +3 -0
- data/lib/shoes/mock/sound.rb +1 -1
- data/lib/shoes/oval.rb +1 -0
- data/lib/shoes/packager.rb +1 -1
- data/lib/shoes/rect.rb +1 -0
- data/lib/shoes/shape.rb +4 -0
- data/lib/shoes/slot.rb +75 -38
- data/lib/shoes/slot_contents.rb +4 -0
- data/lib/shoes/sound.rb +3 -2
- data/lib/shoes/star.rb +1 -0
- data/lib/shoes/text_block.rb +18 -2
- data/lib/shoes/text_block_dimensions.rb +19 -3
- data/lib/shoes/timer.rb +2 -2
- data/lib/shoes/ui/picker.rb +4 -4
- data/lib/shoes/version.rb +1 -1
- data/shoes-core.gemspec +1 -1
- data/spec/shoes/animation_spec.rb +2 -2
- data/spec/shoes/app_spec.rb +6 -17
- data/spec/shoes/arc_spec.rb +2 -1
- data/spec/shoes/background_spec.rb +2 -2
- data/spec/shoes/border_spec.rb +2 -2
- data/spec/shoes/builtin_methods_spec.rb +68 -56
- data/spec/shoes/button_spec.rb +3 -3
- data/spec/shoes/check_spec.rb +3 -2
- data/spec/shoes/color_spec.rb +9 -3
- data/spec/shoes/common/remove_spec.rb +0 -1
- data/spec/shoes/common/rotate_spec.rb +13 -0
- data/spec/shoes/common/style_spec.rb +12 -3
- data/spec/shoes/configuration_spec.rb +18 -3
- data/spec/shoes/constants_spec.rb +1 -0
- data/spec/shoes/dialog_spec.rb +1 -3
- data/spec/shoes/dimension_spec.rb +33 -24
- data/spec/shoes/dimensions_spec.rb +21 -31
- data/spec/shoes/download_spec.rb +14 -3
- data/spec/shoes/flow_spec.rb +6 -7
- data/spec/shoes/font_spec.rb +2 -3
- data/spec/shoes/framework_learning_spec.rb +1 -2
- data/spec/shoes/gradient_spec.rb +1 -2
- data/spec/shoes/helpers/fake_absolute_element.rb +30 -0
- data/spec/shoes/helpers/sample17_helper.rb +0 -1
- data/spec/shoes/image_spec.rb +2 -1
- data/spec/shoes/input_box_spec.rb +2 -2
- data/spec/shoes/integration_spec.rb +0 -1
- data/spec/shoes/internal_app_spec.rb +4 -5
- data/spec/shoes/keypress_spec.rb +1 -1
- data/spec/shoes/keyrelease_spec.rb +1 -2
- data/spec/shoes/line_spec.rb +3 -2
- data/spec/shoes/link_spec.rb +26 -6
- data/spec/shoes/list_box_spec.rb +2 -2
- data/spec/shoes/oval_spec.rb +2 -1
- data/spec/shoes/packager_spec.rb +1 -1
- data/spec/shoes/point_spec.rb +1 -1
- data/spec/shoes/progress_spec.rb +1 -1
- data/spec/shoes/radio_spec.rb +1 -1
- data/spec/shoes/rect_spec.rb +2 -1
- data/spec/shoes/renamed_delegate_spec.rb +0 -1
- data/spec/shoes/shape_spec.rb +1 -1
- data/spec/shoes/shared_examples/common_methods.rb +1 -1
- data/spec/shoes/shared_examples/dsl/animate.rb +1 -1
- data/spec/shoes/shared_examples/dsl/background.rb +2 -2
- data/spec/shoes/shared_examples/dsl/rgb.rb +4 -2
- data/spec/shoes/shared_examples/dsl/star.rb +0 -1
- data/spec/shoes/shared_examples/dsl/style.rb +1 -1
- data/spec/shoes/shared_examples/dsl/text_elements.rb +2 -2
- data/spec/shoes/shared_examples/dsl/video.rb +1 -1
- data/spec/shoes/shared_examples/dsl_app_context.rb +4 -1
- data/spec/shoes/shared_examples/hover.rb +78 -0
- data/spec/shoes/shared_examples/slot.rb +34 -4
- data/spec/shoes/shared_examples/state.rb +9 -2
- data/spec/shoes/shared_examples/style.rb +0 -5
- data/spec/shoes/slot_spec.rb +11 -38
- data/spec/shoes/sound_spec.rb +3 -2
- data/spec/shoes/span_spec.rb +2 -2
- data/spec/shoes/spec_helper.rb +1 -1
- data/spec/shoes/stack_spec.rb +6 -6
- data/spec/shoes/star_spec.rb +2 -1
- data/spec/shoes/text_block_dimensions_spec.rb +3 -4
- data/spec/shoes/text_block_spec.rb +16 -11
- data/spec/shoes/ui/picker_spec.rb +5 -6
- data/spec/shoes/url_spec.rb +1 -2
- data/spec/shoes/widget_spec.rb +11 -3
- data/spec/shoes_spec.rb +1 -4
- data/spec/spec_helper.rb +2 -1
- metadata +16 -9
- data/bin/shoes-guard +0 -8
- data/lib/shoes/link_hover.rb +0 -5
- data/spec/shoes/shared_examples/hover_leave.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1ef269a6d0c75e333dd8592da3a015c91b94aed
|
4
|
+
data.tar.gz: 5f827551fdacff4074c2bb9050104c83e10ca5e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 742d48be0d8c9b7f6d17e8c9d96dc93ed5db1c8076d3430ac1e91d9126d948b996f54ed422a7a2a81e8e646cf1d374484cb457dcd554a370691eee700786e2ff
|
7
|
+
data.tar.gz: 7388924d45215cb1ae721ef6feed84562c4dd3050c4a35a587f80442258b4579b5006b0e70c445f1a03761ce421a22c66ae770749cc14e7b02780d63226a6925
|
data/Guardfile
ADDED
data/bin/shoes
CHANGED
data/bin/shoes-stub
CHANGED
data/ext/install/Rakefile
CHANGED
@@ -15,15 +15,25 @@ require 'fileutils'
|
|
15
15
|
# We also provide a Rubygems plugin to clean up our manual file on uninstall.
|
16
16
|
# Post-install hooks didn't seem to work, though, hence the extension trick.
|
17
17
|
|
18
|
-
task :
|
18
|
+
task default: ['install_script']
|
19
19
|
|
20
20
|
task :install_script do
|
21
|
+
# If we're run via jruby-complete.jar, bindir is within the jar itself so
|
22
|
+
# look for bin based on user directory. Otherwise, prefer Gem.bindir.
|
23
|
+
if Gem.bindir.start_with?("uri:classloader")
|
24
|
+
dest_dir = Gem.bindir(Gem.user_dir)
|
25
|
+
else
|
26
|
+
dest_dir = Gem.bindir
|
27
|
+
end
|
28
|
+
|
21
29
|
if Gem.win_platform?
|
22
|
-
source_path = File.join(
|
23
|
-
dest_path = File.join(
|
30
|
+
source_path = File.join(Dir.pwd, "shoes.bat")
|
31
|
+
dest_path = File.join(dest_dir, "shoes.bat")
|
24
32
|
else
|
25
|
-
source_path = File.join(
|
26
|
-
dest_path = File.join(
|
33
|
+
source_path = File.join(Dir.pwd, "..", "..", "bin", "shoes-stub")
|
34
|
+
dest_path = File.join(dest_dir, "shoes")
|
27
35
|
end
|
36
|
+
|
37
|
+
FileUtils.mkdir_p(dest_dir)
|
28
38
|
FileUtils.cp(source_path, dest_path)
|
29
39
|
end
|
data/ext/install/shoes.bat
CHANGED
@@ -7,7 +7,7 @@ if not defined bin_dir set bin_dir=%~dp0
|
|
7
7
|
if not exist !bin_dir!\shoes-backend (
|
8
8
|
REM TODO: Can we get rid of jruby in some way here? My Windows box didn't
|
9
9
|
REM have a global ruby installed by just installing jruby :(
|
10
|
-
jruby
|
10
|
+
jruby !bin_dir!\shoes-picker !bin_dir!
|
11
11
|
)
|
12
12
|
|
13
13
|
set shoes_bin_dir=!bin_dir!
|
data/lib/shoes/animation.rb
CHANGED
@@ -17,10 +17,10 @@ class Shoes
|
|
17
17
|
@blk = @app.current_slot.create_bound_block(blk)
|
18
18
|
@current_frame = 0
|
19
19
|
@stopped = false
|
20
|
-
@gui = Shoes.
|
20
|
+
@gui = Shoes.backend_for(self)
|
21
21
|
end
|
22
22
|
|
23
|
-
attr_reader :current_frame, :framerate, :blk
|
23
|
+
attr_reader :current_frame, :framerate, :blk, :app
|
24
24
|
|
25
25
|
def start
|
26
26
|
@stopped = false
|
data/lib/shoes/arc.rb
CHANGED
@@ -17,24 +17,11 @@ class Shoes
|
|
17
17
|
Shoes::Dialog.new.confirm(message)
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
def debug(message = '')
|
26
|
-
Shoes::LOG << ['debug', message]
|
27
|
-
Shoes.logger.debug message
|
28
|
-
end
|
29
|
-
|
30
|
-
def warn(message = '')
|
31
|
-
Shoes::LOG << ['warn', message]
|
32
|
-
Shoes.logger.warn message
|
33
|
-
end
|
34
|
-
|
35
|
-
def error(message = '')
|
36
|
-
Shoes::LOG << ['error', message]
|
37
|
-
Shoes.logger.error message
|
20
|
+
%w(info debug warn error).each do |log_level|
|
21
|
+
define_method(log_level) do |message = ''|
|
22
|
+
Shoes::LOG << [log_level, message]
|
23
|
+
Shoes.logger.public_send(log_level, message)
|
24
|
+
end
|
38
25
|
end
|
39
26
|
|
40
27
|
alias_method :confirm?, :confirm
|
data/lib/shoes/button.rb
CHANGED
@@ -3,6 +3,7 @@ class Shoes
|
|
3
3
|
include Common::UIElement
|
4
4
|
include Common::Style
|
5
5
|
include Common::Clickable
|
6
|
+
include Common::State
|
6
7
|
|
7
8
|
style_with :click, :common_styles, :dimensions, :state, :text
|
8
9
|
|
@@ -13,10 +14,5 @@ class Shoes
|
|
13
14
|
def focus
|
14
15
|
@gui.focus
|
15
16
|
end
|
16
|
-
|
17
|
-
def state=(value)
|
18
|
-
style(state: value)
|
19
|
-
@gui.enabled value.nil?
|
20
|
-
end
|
21
17
|
end
|
22
18
|
end
|
data/lib/shoes/check_button.rb
CHANGED
@@ -3,6 +3,7 @@ class Shoes
|
|
3
3
|
include Common::UIElement
|
4
4
|
include Common::Style
|
5
5
|
include Common::Clickable
|
6
|
+
include Common::State
|
6
7
|
|
7
8
|
def checked?
|
8
9
|
@gui.checked?
|
@@ -16,11 +17,6 @@ class Shoes
|
|
16
17
|
def focus
|
17
18
|
@gui.focus
|
18
19
|
end
|
19
|
-
|
20
|
-
def state=(value)
|
21
|
-
style(state: value)
|
22
|
-
@gui.enabled value.nil?
|
23
|
-
end
|
24
20
|
end
|
25
21
|
|
26
22
|
class Check < CheckButton
|
data/lib/shoes/color.rb
CHANGED
@@ -60,6 +60,7 @@ EOS
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def <=>(other)
|
63
|
+
return nil unless other.is_a?(self.class)
|
63
64
|
if same_base_color?(other)
|
64
65
|
@alpha <=> other.alpha
|
65
66
|
else
|
@@ -104,279 +105,9 @@ EOS
|
|
104
105
|
-1
|
105
106
|
end
|
106
107
|
end
|
107
|
-
|
108
|
-
|
109
|
-
class HexConverter
|
110
|
-
def initialize(hex)
|
111
|
-
@hex = validate(hex) || fail(ArgumentError, "Bad hex color: #{hex}")
|
112
|
-
@red, @green, @blue = hex_to_rgb(pad_if_necessary @hex)
|
113
|
-
end
|
114
|
-
|
115
|
-
def to_rgb
|
116
|
-
[@red, @green, @blue]
|
117
|
-
end
|
118
|
-
|
119
|
-
private
|
120
|
-
|
121
|
-
def hex_to_rgb(hex)
|
122
|
-
hex.chars.each_slice(2).map { |a| a.join.to_i(16) }
|
123
|
-
end
|
124
|
-
|
125
|
-
def pad_if_necessary(hex)
|
126
|
-
return hex unless hex.length == 3
|
127
|
-
hex.chars.map { |c| "#{c}#{c}" }.join
|
128
|
-
end
|
129
|
-
|
130
|
-
# Returns a 3- or 6-char hex string for valid input, or nil
|
131
|
-
# for invalid input.
|
132
|
-
def validate(hex)
|
133
|
-
match = /^#?(([0-9a-f]{3}){1,2})$/i.match(hex)
|
134
|
-
match && match[1]
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
module DSLHelpers
|
139
|
-
def pattern(*args)
|
140
|
-
if args.length == 1
|
141
|
-
arg = args.first
|
142
|
-
case arg
|
143
|
-
when String
|
144
|
-
image_file?(arg) ? image_pattern(arg) : color(arg)
|
145
|
-
when Shoes::Color
|
146
|
-
color arg
|
147
|
-
when Range, Shoes::Gradient
|
148
|
-
gradient(arg)
|
149
|
-
when Shoes::ImagePattern
|
150
|
-
arg
|
151
|
-
else
|
152
|
-
fail ArgumentError, "Bad pattern: #{arg.inspect}"
|
153
|
-
end
|
154
|
-
else
|
155
|
-
gradient(*args)
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
def color(arg)
|
160
|
-
Shoes::Color.create(arg)
|
161
|
-
end
|
162
|
-
|
163
|
-
def rgb(red, green, blue, alpha = Shoes::Color::OPAQUE)
|
164
|
-
Shoes::Color.new(red, green, blue, alpha)
|
165
|
-
end
|
166
|
-
|
167
|
-
# Creates a new Shoes::Gradient
|
168
|
-
#
|
169
|
-
# @overload gradient(from, to)
|
170
|
-
# @param [Shoes::Color] from the starting color
|
171
|
-
# @param [Shoes::Color] to the ending color
|
172
|
-
#
|
173
|
-
# @overload gradient(from, to)
|
174
|
-
# @param [String] from a hex string representing the starting color
|
175
|
-
# @param [String] to a hex string representing the ending color
|
176
|
-
#
|
177
|
-
# @overload gradient(range)
|
178
|
-
# @param [Range<Shoes::Color>] range min color to max color
|
179
|
-
#
|
180
|
-
# @overload gradient(range)
|
181
|
-
# @param [Range<String>] range min color to max color
|
182
|
-
def gradient(*args)
|
183
|
-
case args.length
|
184
|
-
when 1
|
185
|
-
arg = args[0]
|
186
|
-
case arg
|
187
|
-
when Gradient
|
188
|
-
min, max = arg.color1, arg.color2
|
189
|
-
when Range
|
190
|
-
min, max = arg.first, arg.last
|
191
|
-
else
|
192
|
-
fail ArgumentError, "Can't make gradient out of #{arg.inspect}"
|
193
|
-
end
|
194
|
-
when 2
|
195
|
-
min, max = args[0], args[1]
|
196
|
-
else
|
197
|
-
fail ArgumentError, "Wrong number of arguments (#{args.length} for 1 or 2)"
|
198
|
-
end
|
199
|
-
Shoes::Gradient.new(color(min), color(max))
|
200
|
-
end
|
201
|
-
|
202
|
-
def gray(level = 128, alpha = Shoes::Color::OPAQUE)
|
203
|
-
Shoes::Color.new(level, level, level, alpha)
|
204
|
-
end
|
205
|
-
|
206
|
-
alias_method :grey, :gray
|
207
|
-
|
208
|
-
private
|
209
|
-
|
210
|
-
def image_file?(arg)
|
211
|
-
arg =~ /\.gif|jpg|jpeg|png$/
|
212
|
-
end
|
213
|
-
|
214
|
-
def image_pattern(path)
|
215
|
-
Shoes::ImagePattern.new path if File.exist?(path)
|
216
|
-
end
|
217
|
-
end
|
218
|
-
end
|
219
|
-
|
220
|
-
# Create all of the built-in Shoes colors
|
221
|
-
COLORS = {}
|
222
|
-
|
223
|
-
module DSL
|
224
|
-
colors = [
|
225
|
-
[:aliceblue, 240, 248, 255],
|
226
|
-
[:antiquewhite, 250, 235, 215],
|
227
|
-
[:aqua, 0, 255, 255],
|
228
|
-
[:aquamarine, 127, 255, 212],
|
229
|
-
[:azure, 240, 255, 255],
|
230
|
-
[:beige, 245, 245, 220],
|
231
|
-
[:bisque, 255, 228, 196],
|
232
|
-
[:black, 0, 0, 0],
|
233
|
-
[:blanchedalmond, 255, 235, 205],
|
234
|
-
[:blue, 0, 0, 255],
|
235
|
-
[:blueviolet, 138, 43, 226],
|
236
|
-
[:brown, 165, 42, 42],
|
237
|
-
[:burlywood, 222, 184, 135],
|
238
|
-
[:cadetblue, 95, 158, 160],
|
239
|
-
[:chartreuse, 127, 255, 0],
|
240
|
-
[:chocolate, 210, 105, 30],
|
241
|
-
[:coral, 255, 127, 80],
|
242
|
-
[:cornflowerblue, 100, 149, 237],
|
243
|
-
[:cornsilk, 255, 248, 220],
|
244
|
-
[:crimson, 220, 20, 60],
|
245
|
-
[:cyan, 0, 255, 255],
|
246
|
-
[:darkblue, 0, 0, 139],
|
247
|
-
[:darkcyan, 0, 139, 139],
|
248
|
-
[:darkgoldenrod, 184, 134, 11],
|
249
|
-
[:darkgray, 169, 169, 169],
|
250
|
-
[:darkgrey, 169, 169, 169],
|
251
|
-
[:darkgreen, 0, 100, 0],
|
252
|
-
[:darkkhaki, 189, 183, 107],
|
253
|
-
[:darkmagenta, 139, 0, 139],
|
254
|
-
[:darkolivegreen, 85, 107, 47],
|
255
|
-
[:darkorange, 255, 140, 0],
|
256
|
-
[:darkorchid, 153, 50, 204],
|
257
|
-
[:darkred, 139, 0, 0],
|
258
|
-
[:darksalmon, 233, 150, 122],
|
259
|
-
[:darkseagreen, 143, 188, 143],
|
260
|
-
[:darkslateblue, 72, 61, 139],
|
261
|
-
[:darkslategray, 47, 79, 79],
|
262
|
-
[:darkslategrey, 47, 79, 79],
|
263
|
-
[:darkturquoise, 0, 206, 209],
|
264
|
-
[:darkviolet, 148, 0, 211],
|
265
|
-
[:deeppink, 255, 20, 147],
|
266
|
-
[:deepskyblue, 0, 191, 255],
|
267
|
-
[:dimgray, 105, 105, 105],
|
268
|
-
[:dimgrey, 105, 105, 105],
|
269
|
-
[:dodgerblue, 30, 144, 255],
|
270
|
-
[:firebrick, 178, 34, 34],
|
271
|
-
[:floralwhite, 255, 250, 240],
|
272
|
-
[:forestgreen, 34, 139, 34],
|
273
|
-
[:fuchsia, 255, 0, 255],
|
274
|
-
[:gainsboro, 220, 220, 220],
|
275
|
-
[:ghostwhite, 248, 248, 255],
|
276
|
-
[:gold, 255, 215, 0],
|
277
|
-
[:goldenrod, 218, 165, 32],
|
278
|
-
[:green, 0, 128, 0],
|
279
|
-
[:greenyellow, 173, 255, 47],
|
280
|
-
[:honeydew, 240, 255, 240],
|
281
|
-
[:hotpink, 255, 105, 180],
|
282
|
-
[:indianred, 205, 92, 92],
|
283
|
-
[:indigo, 75, 0, 130],
|
284
|
-
[:ivory, 255, 255, 240],
|
285
|
-
[:khaki, 240, 230, 140],
|
286
|
-
[:lavender, 230, 230, 250],
|
287
|
-
[:lavenderblush, 255, 240, 245],
|
288
|
-
[:lawngreen, 124, 252, 0],
|
289
|
-
[:lemonchiffon, 255, 250, 205],
|
290
|
-
[:lightblue, 173, 216, 230],
|
291
|
-
[:lightcoral, 240, 128, 128],
|
292
|
-
[:lightcyan, 224, 255, 255],
|
293
|
-
[:lightgoldenrodyellow, 250, 250, 210],
|
294
|
-
[:lightgreen, 144, 238, 144],
|
295
|
-
[:lightgray, 211, 211, 211],
|
296
|
-
[:lightgrey, 211, 211, 211],
|
297
|
-
[:lightpink, 255, 182, 193],
|
298
|
-
[:lightsalmon, 255, 160, 122],
|
299
|
-
[:lightseagreen, 32, 178, 170],
|
300
|
-
[:lightskyblue, 135, 206, 250],
|
301
|
-
[:lightslategray, 119, 136, 153],
|
302
|
-
[:lightslategrey, 119, 136, 153],
|
303
|
-
[:lightsteelblue, 176, 196, 222],
|
304
|
-
[:lightyellow, 255, 255, 224],
|
305
|
-
[:lime, 0, 255, 0],
|
306
|
-
[:limegreen, 50, 205, 50],
|
307
|
-
[:linen, 250, 240, 230],
|
308
|
-
[:magenta, 255, 0, 255],
|
309
|
-
[:maroon, 128, 0, 0],
|
310
|
-
[:mediumaquamarine, 102, 205, 170],
|
311
|
-
[:mediumblue, 0, 0, 205],
|
312
|
-
[:mediumorchid, 186, 85, 211],
|
313
|
-
[:mediumpurple, 147, 112, 219],
|
314
|
-
[:mediumseagreen, 60, 179, 113],
|
315
|
-
[:mediumslateblue, 123, 104, 238],
|
316
|
-
[:mediumspringgreen, 0, 250, 154],
|
317
|
-
[:mediumturquoise, 72, 209, 204],
|
318
|
-
[:mediumvioletred, 199, 21, 133],
|
319
|
-
[:midnightblue, 25, 25, 112],
|
320
|
-
[:mintcream, 245, 255, 250],
|
321
|
-
[:mistyrose, 255, 228, 225],
|
322
|
-
[:moccasin, 255, 228, 181],
|
323
|
-
[:navajowhite, 255, 222, 173],
|
324
|
-
[:navy, 0, 0, 128],
|
325
|
-
[:oldlace, 253, 245, 230],
|
326
|
-
[:olive, 128, 128, 0],
|
327
|
-
[:olivedrab, 107, 142, 35],
|
328
|
-
[:orange, 255, 165, 0],
|
329
|
-
[:orangered, 255, 69, 0],
|
330
|
-
[:orchid, 218, 112, 214],
|
331
|
-
[:palegoldenrod, 238, 232, 170],
|
332
|
-
[:palegreen, 152, 251, 152],
|
333
|
-
[:paleturquoise, 175, 238, 238],
|
334
|
-
[:palevioletred, 219, 112, 147],
|
335
|
-
[:papayawhip, 255, 239, 213],
|
336
|
-
[:peachpuff, 255, 218, 185],
|
337
|
-
[:peru, 205, 133, 63],
|
338
|
-
[:pink, 255, 192, 203],
|
339
|
-
[:plum, 221, 160, 221],
|
340
|
-
[:powderblue, 176, 224, 230],
|
341
|
-
[:purple, 128, 0, 128],
|
342
|
-
[:red, 255, 0, 0],
|
343
|
-
[:rosybrown, 188, 143, 143],
|
344
|
-
[:royalblue, 65, 105, 225],
|
345
|
-
[:saddlebrown, 139, 69, 19],
|
346
|
-
[:salmon, 250, 128, 114],
|
347
|
-
[:sandybrown, 244, 164, 96],
|
348
|
-
[:seagreen, 46, 139, 87],
|
349
|
-
[:seashell, 255, 245, 238],
|
350
|
-
[:sienna, 160, 82, 45],
|
351
|
-
[:silver, 192, 192, 192],
|
352
|
-
[:skyblue, 135, 206, 235],
|
353
|
-
[:slateblue, 106, 90, 205],
|
354
|
-
[:slategray, 112, 128, 144],
|
355
|
-
[:slategrey, 112, 128, 144],
|
356
|
-
[:snow, 255, 250, 250],
|
357
|
-
[:springgreen, 0, 255, 127],
|
358
|
-
[:steelblue, 70, 130, 180],
|
359
|
-
[:tan, 210, 180, 140],
|
360
|
-
[:teal, 0, 128, 128],
|
361
|
-
[:thistle, 216, 191, 216],
|
362
|
-
[:tomato, 255, 99, 71],
|
363
|
-
[:turquoise, 64, 224, 208],
|
364
|
-
[:violet, 238, 130, 238],
|
365
|
-
[:wheat, 245, 222, 179],
|
366
|
-
[:white, 255, 255, 255],
|
367
|
-
[:whitesmoke, 245, 245, 245],
|
368
|
-
[:yellow, 255, 255, 0],
|
369
|
-
[:yellowgreen, 154, 205, 50],
|
370
|
-
[:shoes_background, 237, 237, 237],
|
371
|
-
]
|
372
|
-
|
373
|
-
colors.each do |color_name, r, g, b|
|
374
|
-
Shoes::COLORS[color_name] = Shoes::Color.new(r, g, b)
|
375
|
-
define_method(color_name) do |alpha = Shoes::Color::OPAQUE|
|
376
|
-
color = Shoes::COLORS.fetch(color_name)
|
377
|
-
return color if alpha == Shoes::Color::OPAQUE
|
378
|
-
Shoes::Color.new(color.red, color.green, color.blue, alpha)
|
379
|
-
end
|
380
|
-
end
|
381
108
|
end
|
382
109
|
end
|
110
|
+
|
111
|
+
require 'shoes/color/hex_converter'
|
112
|
+
require 'shoes/color/dsl_helpers'
|
113
|
+
require 'shoes/color/dsl'
|