Sha256: 5a5d0e6ec79ade27060b9b7294266bad4dcc30ebcff5e24317cac6290b0a7f1f

Contents?: true

Size: 802 Bytes

Versions: 3

Compression:

Stored size: 802 Bytes

Contents

require_relative 'color_validator'

module Squib::Args
  module_function def extract_drop_shadow(opts, deck)
    DropShadow.new(deck.custom_colors).extract! opts, deck
  end

  class DropShadow
    include ArgLoader
    include ColorValidator

    def initialize(custom_colors)
      @custom_colors = custom_colors
    end

    def self.parameters
      {
        shadow_color: :black,
        shadow_offset_x: 3,
        shadow_offset_y: 3,
        shadow_radius: nil,
        shadow_trim: 0,
      }
    end

    def self.expanding_parameters
      self.parameters.keys # all of them
    end

    def self.params_with_units
      [:shadow_offset_x, :shadow_offset_y, :shadow_radius, :shadow_trim]
    end

    def validate_shadow_color(arg, _i)
      colorify(arg, @custom_colors)
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
squib-0.19.0 lib/squib/args/drop_shadow.rb
squib-0.19.0b lib/squib/args/drop_shadow.rb
squib-0.19.0a lib/squib/args/drop_shadow.rb