Sha256: f84998f6dde582e97a8b31ebda1bab444ffd92c2247fddc677eeba649fb7d2cc

Contents?: true

Size: 546 Bytes

Versions: 1

Compression:

Stored size: 546 Bytes

Contents

module RubyXL

  # http://www.schemacentral.com/sc/ooxml/e-ssml_color-4.html
  class Color < OOXMLObject
    define_attribute(:auto,    :bool)
    define_attribute(:indexed, :int)
    define_attribute(:rgb,     :string)
    define_attribute(:theme,   :int)
    define_attribute(:tint,    :float)
    define_element_name 'color'

    #validates hex color code, no '#' allowed
    def self.validate_color(color)
      if color =~ /^([a-f]|[A-F]|[0-9]){6}$/
        return true
      else
        raise 'invalid color'
      end
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubyXL-git-ref-6002046-2.0.0 lib/rubyXL/objects/color.rb