Sha256: 06686f95a2c8fd8cbe3cd8532bab9957860f9de0153c600ffce5320dd4662835

Contents?: true

Size: 881 Bytes

Versions: 2

Compression:

Stored size: 881 Bytes

Contents

module Squib
  class Deck
    # Fills the background with the given color
    # @example
    #   background color: :white
    #
    # Options support Arrays, see {file:README.md#Arrays_and_Singleton_Expansion Arrays and Singleon Expansion}
    #
    # @option opts range [Enumerable] (:all) the range of cards over which this will be rendered. See {file:README.md#Specifying_Ranges Specifying Ranges}
    # @option opts color [String] (:black) the color the font will render to. See {file:README.md#Specifying_Colors___Gradients Specifying Colors & Gradients}.
    # @return [nil] nothing
    # @api public
    def background(opts = {})
      range = Args::CardRange.new(opts[:range], deck_size: size)
      draw  = Args::Draw.new(custom_colors).load!(opts, expand_by: size, layout: layout, dpi: dpi)
      range.each { |i| @cards[i].background(draw.color[i]) }
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
squib-0.8.0 lib/squib/api/background.rb
squib-0.7.0 lib/squib/api/background.rb