lib/vedeu/output/presentation/colour.rb in vedeu-0.6.1 vs lib/vedeu/output/presentation/colour.rb in vedeu-0.6.2

- old
+ new

@@ -5,82 +5,84 @@ # Provides colour related presentation behaviour. # module Colour # When the background colour for the model exists, return it, otherwise - # returns the parent background colour, or an empty Vedeu::Background. + # returns the parent background colour, or an empty + # Vedeu::Colours::Background. # - # @return [Vedeu::Background] + # @return [Vedeu::Colours::Background] def background @background ||= if colour colour.background elsif parent parent.background else - Vedeu::Background.new + Vedeu::Colours::Background.new end end # Allows the setting of the background colour by coercing the given value - # into a Vedeu::Background colour. + # into a Vedeu::Colours::Background colour. # - # @return [Vedeu::Background] + # @return [Vedeu::Colours::Background] def background=(value) - @colour = Vedeu::Colour.coerce( - background: Vedeu::Background.coerce(value), + @colour = Vedeu::Colours::Colour.coerce( + background: Vedeu::Colours::Background.coerce(value), foreground: colour.foreground) end - # @return [Vedeu::Colour] + # @return [Vedeu::Colours::Colour] def colour @colour ||= if attributes[:colour] - Vedeu::Colour.coerce(attributes[:colour]) + Vedeu::Colours::Colour.coerce(attributes[:colour]) elsif parent - Vedeu::Colour.coerce(parent.colour) + Vedeu::Colours::Colour.coerce(parent.colour) else - Vedeu::Colour.new + Vedeu::Colours::Colour.new end end # Allows the setting of the model's colour by coercing the given value - # into a Vedeu::Colour. + # into a Vedeu::Colours::Colour. # - # @return [Vedeu::Colour] + # @return [Vedeu::Colours::Colour] def colour=(value) - @colour = Vedeu::Colour.coerce(value) + @colour = Vedeu::Colours::Colour.coerce(value) end # When the foreground colour for the model exists, return it, otherwise - # returns the parent foreground colour, or an empty Vedeu::Foreground. + # returns the parent foreground colour, or an empty + # Vedeu::Colours::Foreground. # - # @return [Vedeu::Foreground] + # @return [Vedeu::Colours::Foreground] def foreground @foreground ||= if colour colour.foreground elsif parent parent.foreground else - Vedeu::Foreground.new + Vedeu::Colours::Foreground.new end end # Allows the setting of the foreground colour by coercing the given value - # into a Vedeu::Foreground colour. + # into a Vedeu::Colours::Foreground colour. # - # @return [Vedeu::Foreground] + # @return [Vedeu::Colours::Foreground] def foreground=(value) - @colour = Vedeu::Colour.coerce( + @colour = Vedeu::Colours::Colour.coerce( background: colour.background, - foreground: Vedeu::Foreground.coerce(value)) + foreground: Vedeu::Colours::Foreground.coerce(value)) end end # Colour end # Presentation