dedalus 0.2.2 → 0.2.3
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/lib/dedalus/elements/icon.rb +4 -0
- data/lib/dedalus/elements/image.rb +1 -1
- data/lib/dedalus/elements.rb +10 -2
- data/lib/dedalus/pattern_library/molecules/library_item_example.rb +19 -7
- data/lib/dedalus/pattern_library/molecules/library_section_tab.rb +0 -1
- data/lib/dedalus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6770d8ee7a4259b2865dac4d0d6d77cf47bda464
|
4
|
+
data.tar.gz: 78cbe61712663be7e795b7d54380a7657e7f47dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddca14f956976eb7d18c2d9b612ea1d890b20f4597e3ee1743df85917aa51973622b3916d573b8c68a9af3b01622195df08c46681f043eae3b3e29091c9740e9
|
7
|
+
data.tar.gz: a3cb9b73a99f5990003845d32ded7551963243d94ce28fe16f7dd3ea1515ad439538d348f744c325ca4790dd8e1b303c39681640f354cbb1d18891eddaf64a2c
|
data/lib/dedalus/elements.rb
CHANGED
@@ -26,7 +26,7 @@ module Dedalus
|
|
26
26
|
attr_accessor :width, :height
|
27
27
|
|
28
28
|
attr_accessor :padding, :margin
|
29
|
-
attr_accessor :background_color
|
29
|
+
attr_accessor :color, :background_color
|
30
30
|
|
31
31
|
def initialize(attrs={})
|
32
32
|
attrs.each { |(k,v)| instance_variable_set(:"@#{k}",v) } unless attrs.nil?
|
@@ -54,7 +54,7 @@ module Dedalus
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def code_font
|
57
|
-
FontRepository.get_font('courier new', size:
|
57
|
+
FontRepository.get_font('courier new', size: 20)
|
58
58
|
end
|
59
59
|
|
60
60
|
def font
|
@@ -72,6 +72,14 @@ module Dedalus
|
|
72
72
|
def window
|
73
73
|
view.window
|
74
74
|
end
|
75
|
+
|
76
|
+
def background_color
|
77
|
+
@background_color ||= if color
|
78
|
+
Palette.decode_color(color)
|
79
|
+
else
|
80
|
+
nil
|
81
|
+
end
|
82
|
+
end
|
75
83
|
end
|
76
84
|
|
77
85
|
###
|
@@ -8,10 +8,26 @@ module Dedalus
|
|
8
8
|
attr_accessor :color
|
9
9
|
|
10
10
|
def show
|
11
|
+
[[
|
12
|
+
periodic_table_entry,
|
13
|
+
example
|
14
|
+
]]
|
15
|
+
end
|
16
|
+
|
17
|
+
def periodic_table_entry
|
18
|
+
PeriodicTableEntry.new(
|
19
|
+
element_name: name,
|
20
|
+
color: color,
|
21
|
+
kind: kind,
|
22
|
+
scale: 1.8
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
def example
|
11
27
|
[
|
12
|
-
|
28
|
+
LargeText.new(text: "EXAMPLE", height_percent: 0.05, color: color),
|
13
29
|
item,
|
14
|
-
|
30
|
+
LargeText.new(text: "DATA", height_percent: 0.05, color: color),
|
15
31
|
Code.new(text: item_data, background_color: Palette.decode_color('darkgray'), padding: 10)
|
16
32
|
]
|
17
33
|
end
|
@@ -25,11 +41,7 @@ module Dedalus
|
|
25
41
|
end
|
26
42
|
|
27
43
|
def background_color
|
28
|
-
|
29
|
-
Palette.decode_color(color).darken
|
30
|
-
else
|
31
|
-
Palette.gray
|
32
|
-
end
|
44
|
+
nil
|
33
45
|
end
|
34
46
|
|
35
47
|
def self.description
|
data/lib/dedalus/version.rb
CHANGED