nyle 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/nyle/frame.rb +4 -0
- data/lib/nyle/version.rb +1 -1
- data/samples/application/sugar.rb +1 -1
- data/samples/basic/color_chart.rb +275 -272
- data/samples/basic/draw_circle.rb +11 -11
- data/samples/basic/draw_line.rb +20 -20
- data/samples/basic/draw_rect.rb +11 -11
- data/samples/basic/draw_text.rb +10 -10
- data/samples/basic/rotation.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 874f7f0908c736a7ce019bbbb4ef5e051e467bbbd678e258e76dcd6b5007c19a
|
4
|
+
data.tar.gz: efe32f88f521412100b605a33569506665f346ff8e852e49c3d63fa779858155
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 948a2be8d3330f63f9066b10b41075cd87988b718c951cde2bb36bc544762779469a059b41ca692acd1eaf94b5134bacfc3511c8ff31aefcd57f7c7f84ab728d
|
7
|
+
data.tar.gz: a9a60aac68010cce74351a2dea287128fc4e00306602b23e87715f8976ea0b5c67236e70521ce08634d433fc768158024c0725d7489a8f916d0fb1cf8020d64c
|
data/CHANGELOG.md
CHANGED
data/lib/nyle/frame.rb
CHANGED
data/lib/nyle/version.rb
CHANGED
@@ -2,35 +2,38 @@ require 'nyle'
|
|
2
2
|
|
3
3
|
class Screen < Nyle::Screen
|
4
4
|
def initialize
|
5
|
-
super(
|
5
|
+
super(600, 600)
|
6
6
|
setup
|
7
7
|
end
|
8
8
|
|
9
9
|
def setup
|
10
|
-
@colors
|
11
|
-
@bar_w
|
12
|
-
@bar_h
|
13
|
-
@
|
14
|
-
@
|
10
|
+
@colors = _color_list
|
11
|
+
@bar_w = 200
|
12
|
+
@bar_h = 30
|
13
|
+
@items_per_page = Nyle.screen_height / @bar_h
|
14
|
+
@pages = @colors.length / @items_per_page + (@colors.length % @items_per_page == 0 ? 0 : 1)
|
15
|
+
@start_index = 0
|
16
|
+
@end_index = _end_index
|
15
17
|
end
|
16
18
|
|
17
19
|
def draw
|
18
20
|
(@start_index..@end_index).each do |i|
|
19
21
|
y = (i - @start_index) * @bar_h
|
20
22
|
Nyle.draw_rect(0, y, @bar_w, @bar_h, {color: @colors[i], fill: true})
|
21
|
-
Nyle.draw_text(@bar_w +
|
23
|
+
Nyle.draw_text(@bar_w + 10, y + @bar_h - 10, "(#{Cairo::Color.module_eval(@colors[i].to_s).to_s[0..6]})", {font: "monospace", color: :BLACK, size: 16})
|
24
|
+
Nyle.draw_text(@bar_w + 110, y + @bar_h - 10, "#{@colors[i].to_s}", {font: "monospace", bold: true, color: :BLACK, size: 16})
|
22
25
|
end
|
23
26
|
end
|
24
27
|
|
25
28
|
def update
|
26
29
|
if Nyle.key_press?(KEY_Up) or Nyle.mouse_press?(MOUSE_R)
|
27
30
|
@start_index -= (Nyle.screen_height / @bar_h)
|
28
|
-
@start_index =
|
31
|
+
@start_index = @items_per_page * (@pages - 1) if @start_index < 0
|
29
32
|
@end_index = _end_index
|
30
33
|
end
|
31
34
|
|
32
35
|
if Nyle.key_press?(KEY_Down) or Nyle.mouse_press?(MOUSE_L)
|
33
|
-
@start_index +=
|
36
|
+
@start_index += @items_per_page
|
34
37
|
@start_index = 0 if @start_index >= @colors.length
|
35
38
|
@end_index = _end_index
|
36
39
|
end
|
@@ -39,275 +42,275 @@ class Screen < Nyle::Screen
|
|
39
42
|
end
|
40
43
|
|
41
44
|
def _end_index
|
42
|
-
index = @start_index +
|
45
|
+
index = @start_index + @items_per_page - 1
|
43
46
|
index = @colors.length - 1 if index >= @colors.length
|
44
47
|
index
|
45
48
|
end
|
46
49
|
|
47
50
|
def _color_list
|
48
51
|
[
|
49
|
-
:ALICE_BLUE, #
|
50
|
-
|
51
|
-
:AMARANTH, #
|
52
|
-
:AMBER, #
|
53
|
-
:AMETHYST, #
|
54
|
-
:ANTIQUE_WHITE, #
|
55
|
-
:APRICOT, #
|
56
|
-
:AQUA, #
|
57
|
-
:AQUAMARINE, #
|
58
|
-
:ASPARAGUS, #
|
59
|
-
:AZURE, #
|
60
|
-
:BEIGE, #
|
61
|
-
:BISQUE, #
|
62
|
-
:BISTRE, #
|
63
|
-
:BLACK, #
|
64
|
-
:BLANCHED_ALMOND, #
|
65
|
-
|
66
|
-
:BLUE, #
|
67
|
-
:BLUE_VIOLET, #
|
68
|
-
:BONDI_BLUE, #
|
69
|
-
:BRIGHT_GREEN, #
|
70
|
-
:BRIGHT_TURQUOISE, #
|
71
|
-
:BROWN, #
|
72
|
-
:BUFF, #
|
73
|
-
:BURGUNDY, #
|
74
|
-
|
75
|
-
:BURNT_ORANGE, #
|
76
|
-
:BURNT_SIENNA, #
|
77
|
-
:BURNT_UMBER, #
|
78
|
-
:CADET_BLUE, #
|
79
|
-
:CAMOUFLAGE_GREEN, #
|
80
|
-
:CARDINAL, #
|
81
|
-
:CARMINE, #
|
82
|
-
|
83
|
-
:CARROT_ORANGE, #
|
84
|
-
:CELADON, #
|
85
|
-
:CERISE, #
|
86
|
-
:CERULEAN, #
|
87
|
-
:CERULEAN_BLUE, #
|
88
|
-
:CHARTREUSE, #
|
89
|
-
|
90
|
-
:CHESTNUT, #
|
91
|
-
:CHOCOLATE, #
|
92
|
-
:CINNAMON, #
|
93
|
-
|
94
|
-
:COPPER, #
|
95
|
-
:COPPER_ROSE, #
|
96
|
-
:CORAL, #
|
97
|
-
:CORAL_RED, #
|
98
|
-
:CORN, #
|
99
|
-
:CORNFLOWER_BLUE, #
|
100
|
-
:CORNSILK, #
|
101
|
-
:CREAM, #
|
102
|
-
:CRIMSON, #
|
103
|
-
:CYAN, #
|
104
|
-
:DARK_BLUE, #
|
105
|
-
:DARK_CYAN, #
|
106
|
-
:DARK_GOLDENROD, #
|
107
|
-
:DARK_GRAY, #
|
108
|
-
:DARK_GREEN, #
|
109
|
-
:DARK_KHAKI, #
|
110
|
-
:DARK_MAGENTA, #
|
111
|
-
:DARK_OLIVE_GREEN, #
|
112
|
-
:DARK_ORANGE, #
|
113
|
-
:DARK_ORCHID, #
|
114
|
-
:DARK_POWDER_BLUE, #
|
115
|
-
:DARK_RED, #
|
116
|
-
:DARK_SALMON, #
|
117
|
-
:DARK_SEA_GREEN, #
|
118
|
-
:DARK_SLATE_BLUE, #
|
119
|
-
:DARK_SLATE_GRAY, #
|
120
|
-
:DARK_TURQUOISE, #
|
121
|
-
:DARK_VIOLET, #
|
122
|
-
:DEEP_PINK, #
|
123
|
-
:DEEP_SKY_BLUE, #
|
124
|
-
:DENIM, #
|
125
|
-
:DIM_GRAY, #
|
126
|
-
:DODGER_BLUE, #
|
127
|
-
:EGGPLANT, #
|
128
|
-
:EMERALD, #
|
129
|
-
:FALU_RED, #
|
130
|
-
:FERN_GREEN, #
|
131
|
-
|
132
|
-
:FLAX, #
|
133
|
-
:FLORAL_WHITE, #
|
134
|
-
:FOREST_GREEN, #
|
135
|
-
:FRENCH_ROSE, #
|
136
|
-
:FUCHSIA, #
|
137
|
-
:GAINSBORO, #
|
138
|
-
:GAMBOGE, #
|
139
|
-
:GHOST_WHITE, #
|
140
|
-
:GOLD, #
|
141
|
-
:GOLDENROD, #
|
142
|
-
:GRAY, #
|
143
|
-
:GRAY_ASPARAGUS, #
|
144
|
-
:GREEN, #
|
145
|
-
:GREEN_YELLOW, #
|
146
|
-
:HARLEQUIN, #
|
147
|
-
:HELIOTROPE, #
|
148
|
-
:HOLLYWOOD_CERISE, #
|
149
|
-
:HONEYDEW, #
|
150
|
-
:HOT_MAGENTA, #
|
151
|
-
:HOT_PINK, #
|
152
|
-
:INDIAN_RED, #
|
153
|
-
:INDIGO, #
|
154
|
-
:INTERNATIONAL_KLEIN_BLUE, #
|
155
|
-
|
156
|
-
:IVORY, #
|
157
|
-
:JADE, #
|
158
|
-
:KHAKI, #
|
159
|
-
:KHAKI_X11, #
|
160
|
-
:LAVENDER, #
|
161
|
-
:LAVENDER_BLUE, #
|
162
|
-
:LAVENDER_BLUSH, #
|
163
|
-
:LAVENDER_GRAY, #
|
164
|
-
:LAVENDER_PINK, #
|
165
|
-
:LAVENDER_ROSE, #
|
166
|
-
:LAWN_GREEN, #
|
167
|
-
:LEMON, #
|
168
|
-
:LEMON_CHIFFON, #
|
169
|
-
:LIGHT_BLUE, #
|
170
|
-
:LIGHT_CORAL, #
|
171
|
-
:LIGHT_CYAN, #
|
172
|
-
:LIGHT_GOLDENROD_YELLOW, #
|
173
|
-
:LIGHT_GREEN, #
|
174
|
-
|
175
|
-
:LIGHT_PINK, #
|
176
|
-
:LIGHT_SALMON, #
|
177
|
-
:LIGHT_SEA_GREEN, #
|
178
|
-
:LIGHT_SKY_BLUE, #
|
179
|
-
:LIGHT_SLATE_GRAY, #
|
180
|
-
:LIGHT_STEEL_BLUE, #
|
181
|
-
:LIGHT_YELLOW, #
|
182
|
-
:LILAC, #
|
183
|
-
:LIME, #
|
184
|
-
:LIME_GREEN, #
|
185
|
-
:LINEN, #
|
186
|
-
:MAGENTA, #
|
187
|
-
:MALACHITE, #
|
188
|
-
:MAROON, #
|
189
|
-
:MAUVE, #
|
190
|
-
:MEDIUM_AQUAMARINE, #
|
191
|
-
:MEDIUM_BLUE, #
|
192
|
-
:MEDIUM_CARMINE, #
|
193
|
-
|
194
|
-
:MEDIUM_ORCHID, #
|
195
|
-
:MEDIUM_PURPLE, #
|
196
|
-
:MEDIUM_SEA_GREEN, #
|
197
|
-
:MEDIUM_SLATE_BLUE, #
|
198
|
-
:MEDIUM_SPRING_GREEN, #
|
199
|
-
:MEDIUM_TURQUOISE, #
|
200
|
-
:MEDIUM_VIOLET_RED, #
|
201
|
-
:MIDNIGHT_BLUE, #
|
202
|
-
:MINT_CREAM, #
|
203
|
-
:MINT_GREEN, #
|
204
|
-
:MISTY_ROSE, #
|
205
|
-
:MOCCASIN, #
|
206
|
-
:MOSS_GREEN, #
|
207
|
-
:MOUNTBATTEN_PINK, #
|
208
|
-
:MUSTARD, #
|
209
|
-
:NAVAJO_WHITE, #
|
210
|
-
:NAVY_BLUE, #
|
211
|
-
:OCHRE, #
|
212
|
-
:OLD_GOLD, #
|
213
|
-
:OLD_LACE, #
|
214
|
-
:OLD_LAVENDER, #
|
215
|
-
:OLD_ROSE, #
|
216
|
-
:OLIVE, #
|
217
|
-
:OLIVE_DRAB, #
|
218
|
-
:ORANGE, #
|
219
|
-
:ORANGE_COLOR_WHEEL, #
|
220
|
-
:ORANGE_PEEL, #
|
221
|
-
:ORANGE_RED, #
|
222
|
-
:ORANGE_WEB, #
|
223
|
-
:ORCHID, #
|
224
|
-
:PALE_GOLDENROD, #
|
225
|
-
:PALE_GREEN, #
|
226
|
-
:PALE_TURQUOISE, #
|
227
|
-
:PALE_VIOLET_RED, #
|
228
|
-
:PAPAYA_WHIP, #
|
229
|
-
:PASTEL_GREEN, #
|
230
|
-
:PASTEL_PINK, #
|
231
|
-
:PEACH, #
|
232
|
-
:PEACH_ORANGE, #
|
233
|
-
:PEACH_PUFF, #
|
234
|
-
:PEACH_YELLOW, #
|
235
|
-
:PEAR, #
|
236
|
-
:PERIWINKLE, #
|
237
|
-
:PERSIAN_BLUE, #
|
238
|
-
:PERSIAN_GREEN, #
|
239
|
-
:PERSIAN_INDIGO, #
|
240
|
-
:PERSIAN_PINK, #
|
241
|
-
:PERSIAN_RED, #
|
242
|
-
:PERSIAN_ROSE, #
|
243
|
-
:PERU, #
|
244
|
-
:PINE_GREEN, #
|
245
|
-
:PINK, #
|
246
|
-
:PINK_ORANGE, #
|
247
|
-
:PLUM, #
|
248
|
-
|
249
|
-
:POWDER_BLUE, #
|
250
|
-
|
251
|
-
:PRUSSIAN_BLUE, #
|
252
|
-
:PUCE, #
|
253
|
-
:PUMPKIN, #
|
254
|
-
:PURPLE, #
|
255
|
-
:RAW_UMBER, #
|
256
|
-
:RED, #
|
257
|
-
:RED_VIOLET, #
|
258
|
-
:ROBIN_EGG_BLUE, #
|
259
|
-
:ROSE, #
|
260
|
-
:ROSY_BROWN, #
|
261
|
-
:ROYAL_BLUE, #
|
262
|
-
:RUSSET, #
|
263
|
-
:RUST, #
|
264
|
-
:SADDLE_BROWN, #
|
265
|
-
:SAFETY_ORANGE, #
|
266
|
-
:SAFFRON, #
|
267
|
-
:SALMON, #
|
268
|
-
:SANDY_BROWN, #
|
269
|
-
|
270
|
-
:SAPPHIRE, #
|
271
|
-
:SCARLET, #
|
272
|
-
:SCHOOL_BUS_YELLOW, #
|
273
|
-
:SEA_GREEN, #
|
274
|
-
:SEASHELL, #
|
275
|
-
:SELECTIVE_YELLOW, #
|
276
|
-
:SEPIA, #
|
277
|
-
:SHOCKING_PINK, #
|
278
|
-
:SIENNA, #
|
279
|
-
:SILVER, #
|
280
|
-
:SKY_BLUE, #
|
281
|
-
:SLATE_BLUE, #
|
282
|
-
:SLATE_GRAY, #
|
283
|
-
|
284
|
-
:SNOW, #
|
285
|
-
:SPRING_GREEN, #
|
286
|
-
:STEEL_BLUE, #
|
287
|
-
|
288
|
-
:TAN, #
|
289
|
-
:TANGERINE, #
|
290
|
-
:TAUPE, #
|
291
|
-
:TAWNY, #
|
292
|
-
:TEA_GREEN, #
|
293
|
-
:TEAL, #
|
294
|
-
|
295
|
-
:TERRA_COTTA, #
|
296
|
-
:THISTLE, #
|
297
|
-
:TOMATO, #
|
298
|
-
:TURQUOISE, #
|
299
|
-
:ULTRAMARINE, #
|
300
|
-
:VERMILION, #
|
301
|
-
:VIOLET, #
|
302
|
-
|
303
|
-
:VIRIDIAN, #
|
304
|
-
:WHEAT, #
|
305
|
-
:WHITE, #
|
306
|
-
:WHITE_SMOKE, #
|
307
|
-
:WISTERIA, #
|
308
|
-
:YELLOW, #
|
309
|
-
:YELLOW_GREEN, #
|
310
|
-
:ZINNWALDITE #
|
52
|
+
:ALICE_BLUE, #
|
53
|
+
#:ALIZARIN_CRIMSON, #
|
54
|
+
:AMARANTH, #
|
55
|
+
:AMBER, #
|
56
|
+
:AMETHYST, #
|
57
|
+
:ANTIQUE_WHITE, #
|
58
|
+
:APRICOT, #
|
59
|
+
:AQUA, #
|
60
|
+
:AQUAMARINE, #
|
61
|
+
:ASPARAGUS, #
|
62
|
+
:AZURE, #
|
63
|
+
:BEIGE, #
|
64
|
+
:BISQUE, #
|
65
|
+
:BISTRE, #
|
66
|
+
:BLACK, #
|
67
|
+
:BLANCHED_ALMOND, #
|
68
|
+
#:BLAZE_ORANGE, #
|
69
|
+
:BLUE, #
|
70
|
+
:BLUE_VIOLET, #
|
71
|
+
:BONDI_BLUE, #
|
72
|
+
:BRIGHT_GREEN, #
|
73
|
+
:BRIGHT_TURQUOISE, #
|
74
|
+
:BROWN, #
|
75
|
+
:BUFF, #
|
76
|
+
:BURGUNDY, #
|
77
|
+
#:BURLY_WOOD, #
|
78
|
+
:BURNT_ORANGE, #
|
79
|
+
:BURNT_SIENNA, #
|
80
|
+
:BURNT_UMBER, #
|
81
|
+
:CADET_BLUE, #
|
82
|
+
:CAMOUFLAGE_GREEN, #
|
83
|
+
:CARDINAL, #
|
84
|
+
:CARMINE, #
|
85
|
+
#:CARNATION, #
|
86
|
+
:CARROT_ORANGE, #
|
87
|
+
:CELADON, #
|
88
|
+
:CERISE, #
|
89
|
+
:CERULEAN, #
|
90
|
+
:CERULEAN_BLUE, #
|
91
|
+
:CHARTREUSE, #
|
92
|
+
#:CHARTREUSE_YELLOW, #
|
93
|
+
:CHESTNUT, #
|
94
|
+
:CHOCOLATE, #
|
95
|
+
:CINNAMON, #
|
96
|
+
#:COBALT, #
|
97
|
+
:COPPER, #
|
98
|
+
:COPPER_ROSE, #
|
99
|
+
:CORAL, #
|
100
|
+
:CORAL_RED, #
|
101
|
+
:CORN, #
|
102
|
+
:CORNFLOWER_BLUE, #
|
103
|
+
:CORNSILK, #
|
104
|
+
:CREAM, #
|
105
|
+
:CRIMSON, #
|
106
|
+
:CYAN, #
|
107
|
+
:DARK_BLUE, #
|
108
|
+
:DARK_CYAN, #
|
109
|
+
:DARK_GOLDENROD, #
|
110
|
+
:DARK_GRAY, #
|
111
|
+
:DARK_GREEN, #
|
112
|
+
:DARK_KHAKI, #
|
113
|
+
:DARK_MAGENTA, #
|
114
|
+
:DARK_OLIVE_GREEN, #
|
115
|
+
:DARK_ORANGE, #
|
116
|
+
:DARK_ORCHID, #
|
117
|
+
:DARK_POWDER_BLUE, #
|
118
|
+
:DARK_RED, #
|
119
|
+
:DARK_SALMON, #
|
120
|
+
:DARK_SEA_GREEN, #
|
121
|
+
:DARK_SLATE_BLUE, #
|
122
|
+
:DARK_SLATE_GRAY, #
|
123
|
+
:DARK_TURQUOISE, #
|
124
|
+
:DARK_VIOLET, #
|
125
|
+
:DEEP_PINK, #
|
126
|
+
:DEEP_SKY_BLUE, #
|
127
|
+
:DENIM, #
|
128
|
+
:DIM_GRAY, #
|
129
|
+
:DODGER_BLUE, #
|
130
|
+
:EGGPLANT, #
|
131
|
+
:EMERALD, #
|
132
|
+
:FALU_RED, #
|
133
|
+
:FERN_GREEN, #
|
134
|
+
#:FIRE_BRICK, #
|
135
|
+
:FLAX, #
|
136
|
+
:FLORAL_WHITE, #
|
137
|
+
:FOREST_GREEN, #
|
138
|
+
:FRENCH_ROSE, #
|
139
|
+
:FUCHSIA, #
|
140
|
+
:GAINSBORO, #
|
141
|
+
:GAMBOGE, #
|
142
|
+
:GHOST_WHITE, #
|
143
|
+
:GOLD, #
|
144
|
+
:GOLDENROD, #
|
145
|
+
:GRAY, #
|
146
|
+
:GRAY_ASPARAGUS, #
|
147
|
+
:GREEN, #
|
148
|
+
:GREEN_YELLOW, #
|
149
|
+
:HARLEQUIN, #
|
150
|
+
:HELIOTROPE, #
|
151
|
+
:HOLLYWOOD_CERISE, #
|
152
|
+
:HONEYDEW, #
|
153
|
+
:HOT_MAGENTA, #
|
154
|
+
:HOT_PINK, #
|
155
|
+
:INDIAN_RED, #
|
156
|
+
:INDIGO, #
|
157
|
+
:INTERNATIONAL_KLEIN_BLUE, #
|
158
|
+
#:INTERNATIONAL_ORANGE, #
|
159
|
+
:IVORY, #
|
160
|
+
:JADE, #
|
161
|
+
:KHAKI, #
|
162
|
+
:KHAKI_X11, #
|
163
|
+
:LAVENDER, #
|
164
|
+
:LAVENDER_BLUE, #
|
165
|
+
:LAVENDER_BLUSH, #
|
166
|
+
:LAVENDER_GRAY, #
|
167
|
+
:LAVENDER_PINK, #
|
168
|
+
:LAVENDER_ROSE, #
|
169
|
+
:LAWN_GREEN, #
|
170
|
+
:LEMON, #
|
171
|
+
:LEMON_CHIFFON, #
|
172
|
+
:LIGHT_BLUE, #
|
173
|
+
:LIGHT_CORAL, #
|
174
|
+
:LIGHT_CYAN, #
|
175
|
+
:LIGHT_GOLDENROD_YELLOW, #
|
176
|
+
:LIGHT_GREEN, #
|
177
|
+
#:LIGHT_GREY, #
|
178
|
+
:LIGHT_PINK, #
|
179
|
+
:LIGHT_SALMON, #
|
180
|
+
:LIGHT_SEA_GREEN, #
|
181
|
+
:LIGHT_SKY_BLUE, #
|
182
|
+
:LIGHT_SLATE_GRAY, #
|
183
|
+
:LIGHT_STEEL_BLUE, #
|
184
|
+
:LIGHT_YELLOW, #
|
185
|
+
:LILAC, #
|
186
|
+
:LIME, #
|
187
|
+
:LIME_GREEN, #
|
188
|
+
:LINEN, #
|
189
|
+
:MAGENTA, #
|
190
|
+
:MALACHITE, #
|
191
|
+
:MAROON, #
|
192
|
+
:MAUVE, #
|
193
|
+
:MEDIUM_AQUAMARINE, #
|
194
|
+
:MEDIUM_BLUE, #
|
195
|
+
:MEDIUM_CARMINE, #
|
196
|
+
#:MEDIUM_LAVENDER, #
|
197
|
+
:MEDIUM_ORCHID, #
|
198
|
+
:MEDIUM_PURPLE, #
|
199
|
+
:MEDIUM_SEA_GREEN, #
|
200
|
+
:MEDIUM_SLATE_BLUE, #
|
201
|
+
:MEDIUM_SPRING_GREEN, #
|
202
|
+
:MEDIUM_TURQUOISE, #
|
203
|
+
:MEDIUM_VIOLET_RED, #
|
204
|
+
:MIDNIGHT_BLUE, #
|
205
|
+
:MINT_CREAM, #
|
206
|
+
:MINT_GREEN, #
|
207
|
+
:MISTY_ROSE, #
|
208
|
+
:MOCCASIN, #
|
209
|
+
:MOSS_GREEN, #
|
210
|
+
:MOUNTBATTEN_PINK, #
|
211
|
+
:MUSTARD, #
|
212
|
+
:NAVAJO_WHITE, #
|
213
|
+
:NAVY_BLUE, #
|
214
|
+
:OCHRE, #
|
215
|
+
:OLD_GOLD, #
|
216
|
+
:OLD_LACE, #
|
217
|
+
:OLD_LAVENDER, #
|
218
|
+
:OLD_ROSE, #
|
219
|
+
:OLIVE, #
|
220
|
+
:OLIVE_DRAB, #
|
221
|
+
:ORANGE, #
|
222
|
+
:ORANGE_COLOR_WHEEL, #
|
223
|
+
:ORANGE_PEEL, #
|
224
|
+
:ORANGE_RED, #
|
225
|
+
:ORANGE_WEB, #
|
226
|
+
:ORCHID, #
|
227
|
+
:PALE_GOLDENROD, #
|
228
|
+
:PALE_GREEN, #
|
229
|
+
:PALE_TURQUOISE, #
|
230
|
+
:PALE_VIOLET_RED, #
|
231
|
+
:PAPAYA_WHIP, #
|
232
|
+
:PASTEL_GREEN, #
|
233
|
+
:PASTEL_PINK, #
|
234
|
+
:PEACH, #
|
235
|
+
:PEACH_ORANGE, #
|
236
|
+
:PEACH_PUFF, #
|
237
|
+
:PEACH_YELLOW, #
|
238
|
+
:PEAR, #
|
239
|
+
:PERIWINKLE, #
|
240
|
+
:PERSIAN_BLUE, #
|
241
|
+
:PERSIAN_GREEN, #
|
242
|
+
:PERSIAN_INDIGO, #
|
243
|
+
:PERSIAN_PINK, #
|
244
|
+
:PERSIAN_RED, #
|
245
|
+
:PERSIAN_ROSE, #
|
246
|
+
:PERU, #
|
247
|
+
:PINE_GREEN, #
|
248
|
+
:PINK, #
|
249
|
+
:PINK_ORANGE, #
|
250
|
+
:PLUM, #
|
251
|
+
#:POMEGRANATE, #
|
252
|
+
:POWDER_BLUE, #
|
253
|
+
#:POWDER_BLUE_WEB, #
|
254
|
+
:PRUSSIAN_BLUE, #
|
255
|
+
:PUCE, #
|
256
|
+
:PUMPKIN, #
|
257
|
+
:PURPLE, #
|
258
|
+
:RAW_UMBER, #
|
259
|
+
:RED, #
|
260
|
+
:RED_VIOLET, #
|
261
|
+
:ROBIN_EGG_BLUE, #
|
262
|
+
:ROSE, #
|
263
|
+
:ROSY_BROWN, #
|
264
|
+
:ROYAL_BLUE, #
|
265
|
+
:RUSSET, #
|
266
|
+
:RUST, #
|
267
|
+
:SADDLE_BROWN, #
|
268
|
+
:SAFETY_ORANGE, #
|
269
|
+
:SAFFRON, #
|
270
|
+
:SALMON, #
|
271
|
+
:SANDY_BROWN, #
|
272
|
+
#:SANGRIA, #
|
273
|
+
:SAPPHIRE, #
|
274
|
+
:SCARLET, #
|
275
|
+
:SCHOOL_BUS_YELLOW, #
|
276
|
+
:SEA_GREEN, #
|
277
|
+
:SEASHELL, #
|
278
|
+
:SELECTIVE_YELLOW, #
|
279
|
+
:SEPIA, #
|
280
|
+
:SHOCKING_PINK, #
|
281
|
+
:SIENNA, #
|
282
|
+
:SILVER, #
|
283
|
+
:SKY_BLUE, #
|
284
|
+
:SLATE_BLUE, #
|
285
|
+
:SLATE_GRAY, #
|
286
|
+
#:SMALT, #
|
287
|
+
:SNOW, #
|
288
|
+
:SPRING_GREEN, #
|
289
|
+
:STEEL_BLUE, #
|
290
|
+
#:SWAMP_GREEN, #
|
291
|
+
:TAN, #
|
292
|
+
:TANGERINE, #
|
293
|
+
:TAUPE, #
|
294
|
+
:TAWNY, #
|
295
|
+
:TEA_GREEN, #
|
296
|
+
:TEAL, #
|
297
|
+
#:TENNE, #
|
298
|
+
:TERRA_COTTA, #
|
299
|
+
:THISTLE, #
|
300
|
+
:TOMATO, #
|
301
|
+
:TURQUOISE, #
|
302
|
+
:ULTRAMARINE, #
|
303
|
+
:VERMILION, #
|
304
|
+
:VIOLET, #
|
305
|
+
#:VIOLET_EGGPLANT, #
|
306
|
+
:VIRIDIAN, #
|
307
|
+
:WHEAT, #
|
308
|
+
:WHITE, #
|
309
|
+
:WHITE_SMOKE, #
|
310
|
+
:WISTERIA, #
|
311
|
+
:YELLOW, #
|
312
|
+
:YELLOW_GREEN, #
|
313
|
+
:ZINNWALDITE #
|
311
314
|
]
|
312
315
|
end
|
313
316
|
end
|
@@ -30,17 +30,17 @@ class Screen < Nyle::Screen
|
|
30
30
|
Nyle.draw_circle(420, 270, 30, {fill: true, a: 0.8, color: :FOREST_GREEN})
|
31
31
|
Nyle.draw_circle(520, 270, 30, {fill: true, a: 1.0, color: :FOREST_GREEN})
|
32
32
|
|
33
|
-
Nyle.draw_circle(120, 340, 30, {fill: true, a: 0.2, color: :
|
34
|
-
Nyle.draw_circle(220, 340, 30, {fill: true, a: 0.4, color: :
|
35
|
-
Nyle.draw_circle(320, 340, 30, {fill: true, a: 0.6, color: :
|
36
|
-
Nyle.draw_circle(420, 340, 30, {fill: true, a: 0.8, color: :
|
37
|
-
Nyle.draw_circle(520, 340, 30, {fill: true, a: 1.0, color: :
|
38
|
-
|
39
|
-
Nyle.draw_circle(120, 410, 30, {fill: true, a: 0.2, color: :
|
40
|
-
Nyle.draw_circle(220, 410, 30, {fill: true, a: 0.4, color: :
|
41
|
-
Nyle.draw_circle(320, 410, 30, {fill: true, a: 0.6, color: :
|
42
|
-
Nyle.draw_circle(420, 410, 30, {fill: true, a: 0.8, color: :
|
43
|
-
Nyle.draw_circle(520, 410, 30, {fill: true, a: 1.0, color: :
|
33
|
+
Nyle.draw_circle(120, 340, 30, {fill: true, a: 0.2, color: :MEDIUM_BLUE})
|
34
|
+
Nyle.draw_circle(220, 340, 30, {fill: true, a: 0.4, color: :MEDIUM_BLUE})
|
35
|
+
Nyle.draw_circle(320, 340, 30, {fill: true, a: 0.6, color: :MEDIUM_BLUE})
|
36
|
+
Nyle.draw_circle(420, 340, 30, {fill: true, a: 0.8, color: :MEDIUM_BLUE})
|
37
|
+
Nyle.draw_circle(520, 340, 30, {fill: true, a: 1.0, color: :MEDIUM_BLUE})
|
38
|
+
|
39
|
+
Nyle.draw_circle(120, 410, 30, {fill: true, a: 0.2, color: :SCHOOL_BUS_YELLOW})
|
40
|
+
Nyle.draw_circle(220, 410, 30, {fill: true, a: 0.4, color: :SCHOOL_BUS_YELLOW})
|
41
|
+
Nyle.draw_circle(320, 410, 30, {fill: true, a: 0.6, color: :SCHOOL_BUS_YELLOW})
|
42
|
+
Nyle.draw_circle(420, 410, 30, {fill: true, a: 0.8, color: :SCHOOL_BUS_YELLOW})
|
43
|
+
Nyle.draw_circle(520, 410, 30, {fill: true, a: 1.0, color: :SCHOOL_BUS_YELLOW})
|
44
44
|
|
45
45
|
Nyle.quit if Nyle.key_press?(KEY_Escape)
|
46
46
|
end
|
data/samples/basic/draw_line.rb
CHANGED
@@ -50,27 +50,27 @@ class Screen < Nyle::Screen
|
|
50
50
|
Nyle.draw_line(460, 310, 520, 250, {weight: 8, cap: :ROUND, a: 0.8, color: :FOREST_GREEN})
|
51
51
|
Nyle.draw_line(510, 310, 570, 250, {weight: 10, cap: :ROUND, a: 1.0, color: :FOREST_GREEN})
|
52
52
|
|
53
|
-
Nyle.draw_line( 40, 390, 100, 330, { a: 0.2, color: :
|
54
|
-
Nyle.draw_line( 90, 390, 150, 330, {weight: 4 , a: 0.4, color: :
|
55
|
-
Nyle.draw_line(140, 390, 200, 330, {weight: 6 , a: 0.6, color: :
|
56
|
-
Nyle.draw_line(190, 390, 250, 330, {weight: 8 , a: 0.8, color: :
|
57
|
-
Nyle.draw_line(240, 390, 300, 330, {weight: 10 , a: 1.0, color: :
|
58
|
-
Nyle.draw_line(310, 390, 370, 330, { cap: :ROUND, a: 0.2, color: :
|
59
|
-
Nyle.draw_line(360, 390, 420, 330, {weight: 4, cap: :ROUND, a: 0.4, color: :
|
60
|
-
Nyle.draw_line(410, 390, 470, 330, {weight: 6, cap: :ROUND, a: 0.6, color: :
|
61
|
-
Nyle.draw_line(460, 390, 520, 330, {weight: 8, cap: :ROUND, a: 0.8, color: :
|
62
|
-
Nyle.draw_line(510, 390, 570, 330, {weight: 10, cap: :ROUND, a: 1.0, color: :
|
53
|
+
Nyle.draw_line( 40, 390, 100, 330, { a: 0.2, color: :MEDIUM_BLUE})
|
54
|
+
Nyle.draw_line( 90, 390, 150, 330, {weight: 4 , a: 0.4, color: :MEDIUM_BLUE})
|
55
|
+
Nyle.draw_line(140, 390, 200, 330, {weight: 6 , a: 0.6, color: :MEDIUM_BLUE})
|
56
|
+
Nyle.draw_line(190, 390, 250, 330, {weight: 8 , a: 0.8, color: :MEDIUM_BLUE})
|
57
|
+
Nyle.draw_line(240, 390, 300, 330, {weight: 10 , a: 1.0, color: :MEDIUM_BLUE})
|
58
|
+
Nyle.draw_line(310, 390, 370, 330, { cap: :ROUND, a: 0.2, color: :MEDIUM_BLUE})
|
59
|
+
Nyle.draw_line(360, 390, 420, 330, {weight: 4, cap: :ROUND, a: 0.4, color: :MEDIUM_BLUE})
|
60
|
+
Nyle.draw_line(410, 390, 470, 330, {weight: 6, cap: :ROUND, a: 0.6, color: :MEDIUM_BLUE})
|
61
|
+
Nyle.draw_line(460, 390, 520, 330, {weight: 8, cap: :ROUND, a: 0.8, color: :MEDIUM_BLUE})
|
62
|
+
Nyle.draw_line(510, 390, 570, 330, {weight: 10, cap: :ROUND, a: 1.0, color: :MEDIUM_BLUE})
|
63
63
|
|
64
|
-
Nyle.draw_line( 40, 470, 100, 410, { a: 0.2, color: :
|
65
|
-
Nyle.draw_line( 90, 470, 150, 410, {weight: 4 , a: 0.4, color: :
|
66
|
-
Nyle.draw_line(140, 470, 200, 410, {weight: 6 , a: 0.6, color: :
|
67
|
-
Nyle.draw_line(190, 470, 250, 410, {weight: 8 , a: 0.8, color: :
|
68
|
-
Nyle.draw_line(240, 470, 300, 410, {weight: 10 , a: 1.0, color: :
|
69
|
-
Nyle.draw_line(310, 470, 370, 410, { cap: :ROUND, a: 0.2, color: :
|
70
|
-
Nyle.draw_line(360, 470, 420, 410, {weight: 4, cap: :ROUND, a: 0.4, color: :
|
71
|
-
Nyle.draw_line(410, 470, 470, 410, {weight: 6, cap: :ROUND, a: 0.6, color: :
|
72
|
-
Nyle.draw_line(460, 470, 520, 410, {weight: 8, cap: :ROUND, a: 0.8, color: :
|
73
|
-
Nyle.draw_line(510, 470, 570, 410, {weight: 10, cap: :ROUND, a: 1.0, color: :
|
64
|
+
Nyle.draw_line( 40, 470, 100, 410, { a: 0.2, color: :SCHOOL_BUS_YELLOW})
|
65
|
+
Nyle.draw_line( 90, 470, 150, 410, {weight: 4 , a: 0.4, color: :SCHOOL_BUS_YELLOW})
|
66
|
+
Nyle.draw_line(140, 470, 200, 410, {weight: 6 , a: 0.6, color: :SCHOOL_BUS_YELLOW})
|
67
|
+
Nyle.draw_line(190, 470, 250, 410, {weight: 8 , a: 0.8, color: :SCHOOL_BUS_YELLOW})
|
68
|
+
Nyle.draw_line(240, 470, 300, 410, {weight: 10 , a: 1.0, color: :SCHOOL_BUS_YELLOW})
|
69
|
+
Nyle.draw_line(310, 470, 370, 410, { cap: :ROUND, a: 0.2, color: :SCHOOL_BUS_YELLOW})
|
70
|
+
Nyle.draw_line(360, 470, 420, 410, {weight: 4, cap: :ROUND, a: 0.4, color: :SCHOOL_BUS_YELLOW})
|
71
|
+
Nyle.draw_line(410, 470, 470, 410, {weight: 6, cap: :ROUND, a: 0.6, color: :SCHOOL_BUS_YELLOW})
|
72
|
+
Nyle.draw_line(460, 470, 520, 410, {weight: 8, cap: :ROUND, a: 0.8, color: :SCHOOL_BUS_YELLOW})
|
73
|
+
Nyle.draw_line(510, 470, 570, 410, {weight: 10, cap: :ROUND, a: 1.0, color: :SCHOOL_BUS_YELLOW})
|
74
74
|
|
75
75
|
Nyle.quit if Nyle.key_press?(KEY_Escape)
|
76
76
|
end
|
data/samples/basic/draw_rect.rb
CHANGED
@@ -36,17 +36,17 @@ class Screen < Nyle::Screen
|
|
36
36
|
Nyle.draw_rect(390, 280, 60, 40, {fill: true, a: 0.8, color: :FOREST_GREEN})
|
37
37
|
Nyle.draw_rect(490, 280, 60, 40, {fill: true, a: 1.0, color: :FOREST_GREEN})
|
38
38
|
|
39
|
-
Nyle.draw_rect( 90, 340, 60, 40, {fill: true, a: 0.2, color: :
|
40
|
-
Nyle.draw_rect(190, 340, 60, 40, {fill: true, a: 0.4, color: :
|
41
|
-
Nyle.draw_rect(290, 340, 60, 40, {fill: true, a: 0.6, color: :
|
42
|
-
Nyle.draw_rect(390, 340, 60, 40, {fill: true, a: 0.8, color: :
|
43
|
-
Nyle.draw_rect(490, 340, 60, 40, {fill: true, a: 1.0, color: :
|
44
|
-
|
45
|
-
Nyle.draw_rect( 90, 400, 60, 40, {fill: true, a: 0.2, color: :
|
46
|
-
Nyle.draw_rect(190, 400, 60, 40, {fill: true, a: 0.4, color: :
|
47
|
-
Nyle.draw_rect(290, 400, 60, 40, {fill: true, a: 0.6, color: :
|
48
|
-
Nyle.draw_rect(390, 400, 60, 40, {fill: true, a: 0.8, color: :
|
49
|
-
Nyle.draw_rect(490, 400, 60, 40, {fill: true, a: 1.0, color: :
|
39
|
+
Nyle.draw_rect( 90, 340, 60, 40, {fill: true, a: 0.2, color: :MEDIUM_BLUE})
|
40
|
+
Nyle.draw_rect(190, 340, 60, 40, {fill: true, a: 0.4, color: :MEDIUM_BLUE})
|
41
|
+
Nyle.draw_rect(290, 340, 60, 40, {fill: true, a: 0.6, color: :MEDIUM_BLUE})
|
42
|
+
Nyle.draw_rect(390, 340, 60, 40, {fill: true, a: 0.8, color: :MEDIUM_BLUE})
|
43
|
+
Nyle.draw_rect(490, 340, 60, 40, {fill: true, a: 1.0, color: :MEDIUM_BLUE})
|
44
|
+
|
45
|
+
Nyle.draw_rect( 90, 400, 60, 40, {fill: true, a: 0.2, color: :SCHOOL_BUS_YELLOW})
|
46
|
+
Nyle.draw_rect(190, 400, 60, 40, {fill: true, a: 0.4, color: :SCHOOL_BUS_YELLOW})
|
47
|
+
Nyle.draw_rect(290, 400, 60, 40, {fill: true, a: 0.6, color: :SCHOOL_BUS_YELLOW})
|
48
|
+
Nyle.draw_rect(390, 400, 60, 40, {fill: true, a: 0.8, color: :SCHOOL_BUS_YELLOW})
|
49
|
+
Nyle.draw_rect(490, 400, 60, 40, {fill: true, a: 1.0, color: :SCHOOL_BUS_YELLOW})
|
50
50
|
|
51
51
|
Nyle.quit if Nyle.key_press?(KEY_Escape)
|
52
52
|
end
|
data/samples/basic/draw_text.rb
CHANGED
@@ -40,18 +40,18 @@ class Screen < Nyle::Screen
|
|
40
40
|
Nyle.draw_text(440, 230, "Nyle", {size: 48, color: :FOREST_GREEN, font: "serif", italic: true, bold: true})
|
41
41
|
|
42
42
|
Nyle.draw_line( 20, 290, 620, 290, {color: :GRAY, a: 0.1})
|
43
|
-
Nyle.draw_text( 80, 290, "Nyle", {size: 18, color: :
|
44
|
-
Nyle.draw_text(140, 290, "Nyle", {size: 24, color: :
|
45
|
-
Nyle.draw_text(220, 290, "Nyle", {size: 32, color: :
|
46
|
-
Nyle.draw_text(320, 290, "Nyle", {size: 42, color: :
|
47
|
-
Nyle.draw_text(440, 290, "Nyle", {size: 48, color: :
|
43
|
+
Nyle.draw_text( 80, 290, "Nyle", {size: 18, color: :MEDIUM_BLUE, font: "monospace"})
|
44
|
+
Nyle.draw_text(140, 290, "Nyle", {size: 24, color: :MEDIUM_BLUE, font: "monospace"})
|
45
|
+
Nyle.draw_text(220, 290, "Nyle", {size: 32, color: :MEDIUM_BLUE, font: "monospace", bold: true})
|
46
|
+
Nyle.draw_text(320, 290, "Nyle", {size: 42, color: :MEDIUM_BLUE, font: "monospace", italic: true})
|
47
|
+
Nyle.draw_text(440, 290, "Nyle", {size: 48, color: :MEDIUM_BLUE, font: "monospace", italic: true, bold: true})
|
48
48
|
|
49
49
|
Nyle.draw_line( 20, 350, 620, 350, {color: :GRAY, a: 0.1})
|
50
|
-
Nyle.draw_text( 80, 350, "Nyle", {size: 18, color: :
|
51
|
-
Nyle.draw_text(140, 350, "Nyle", {size: 24, color: :
|
52
|
-
Nyle.draw_text(220, 350, "Nyle", {size: 32, color: :
|
53
|
-
Nyle.draw_text(320, 350, "Nyle", {size: 42, color: :
|
54
|
-
Nyle.draw_text(440, 350, "Nyle", {size: 48, color: :
|
50
|
+
Nyle.draw_text( 80, 350, "Nyle", {size: 18, color: :SCHOOL_BUS_YELLOW, font: "monospace"})
|
51
|
+
Nyle.draw_text(140, 350, "Nyle", {size: 24, color: :SCHOOL_BUS_YELLOW, font: "monospace"})
|
52
|
+
Nyle.draw_text(220, 350, "Nyle", {size: 32, color: :SCHOOL_BUS_YELLOW, font: "monospace", bold: true})
|
53
|
+
Nyle.draw_text(320, 350, "Nyle", {size: 42, color: :SCHOOL_BUS_YELLOW, font: "monospace", italic: true})
|
54
|
+
Nyle.draw_text(440, 350, "Nyle", {size: 48, color: :SCHOOL_BUS_YELLOW, font: "monospace", italic: true, bold: true})
|
55
55
|
|
56
56
|
Nyle.quit if Nyle.key_press?(KEY_Escape)
|
57
57
|
end
|
data/samples/basic/rotation.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nyle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Koki Kitamura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gtk3
|