Sha256: 5bc71255410f92ea6e6d68218fa73edacfa264980599b143899ce1b0ccb19f25
Contents?: true
Size: 607 Bytes
Versions: 34
Compression:
Stored size: 607 Bytes
Contents
require 'rubyXL/objects/ooxml_object' module RubyXL # http://www.schemacentral.com/sc/ooxml/e-ssml_color-4.html class Color < OOXMLObject define_attribute(:auto, :bool) define_attribute(:indexed, :uint) define_attribute(:rgb, :string) define_attribute(:theme, :uint) define_attribute(:tint, :double, :default => 0.0) define_element_name 'color' #validates hex color code, no '#' allowed def self.validate_color(color) if color =~ /\A([a-f]|[A-F]|[0-9]){6}\Z/ return true else raise 'invalid color' end end end end
Version data entries
34 entries across 34 versions & 1 rubygems