lib/dedalus/elements.rb in dedalus-0.2.2 vs lib/dedalus/elements.rb in dedalus-0.2.3
- old
+ new
@@ -24,11 +24,11 @@
# raw width/height
attr_accessor :width, :height
attr_accessor :padding, :margin
- attr_accessor :background_color
+ attr_accessor :color, :background_color
def initialize(attrs={})
attrs.each { |(k,v)| instance_variable_set(:"@#{k}",v) } unless attrs.nil?
end
@@ -52,11 +52,11 @@
def tiny_font
FontRepository.get_font(size: 14)
end
def code_font
- FontRepository.get_font('courier new', size: 18)
+ FontRepository.get_font('courier new', size: 20)
end
def font
FontRepository.get_font(size: 20)
end
@@ -69,9 +69,17 @@
FontRepository.get_font(size: 120)
end
def window
view.window
+ end
+
+ def background_color
+ @background_color ||= if color
+ Palette.decode_color(color)
+ else
+ nil
+ end
end
end
###