diff --git a/lib/squib/api/text.rb b/lib/squib/api/text.rb index 8ed5c03..6afec1b 100644 --- a/lib/squib/api/text.rb +++ b/lib/squib/api/text.rb @@ -34,7 +34,7 @@ module Squib # @return [nil] Returns nothing # @api public def text(opts = {}) - opts = needs(opts, [:range, :str, :font, :x, :y, :width, :height, :text_color, :wrap, + opts = needs(opts, [:range, :str, :font, :x, :y, :width, :height, :color, :wrap, :align, :justify, :valign, :ellipsize, :hint, :layout]) opts[:str] = [opts[:str]] * @cards.size unless opts[:str].respond_to? :each opts[:range].each do |i| diff --git a/lib/squib/input_helpers.rb b/lib/squib/input_helpers.rb index 0f9d433..468549e 100644 --- a/lib/squib/input_helpers.rb +++ b/lib/squib/input_helpers.rb @@ -15,6 +15,8 @@ module Squib opts = fileify(opts, false, false) if params.include? :file_to_save opts = fileify(opts, true, false) if params.include? :files opts = colorify(opts) if params.include? :color + opts = colorify(opts, false, :fill_color) if params.include? :fill_color + opts = colorify(opts, false, :stroke_color) if params.include? :stroke_color opts = colorify(opts, true) if params.include? :nillable_color opts = dirify(opts) if params.include? :dir opts = dirify(opts, true) if params.include? :creatable_dir @@ -96,12 +98,12 @@ module Squib # :nodoc: # @api private - def colorify(opts, nillable=false) - return opts if nillable && opts[:color].nil? - if @custom_colors.key? opts[:color].to_s - opts[:color] = @custom_colors[opts[:color].to_s] + def colorify(opts, nillable=false, key=:color) + return opts if nillable && opts[key].nil? + if @custom_colors.key? opts[key].to_s + opts[key] = @custom_colors[opts[key].to_s] end - opts[:color] = Cairo::Color.parse(opts[:color]) + opts[key] = Cairo::Color.parse(opts[key]) opts end module_function :colorify