Class: RubyXL::Color
- Inherits:
-
OOXMLObject
- Object
- OOXMLObject
- RubyXL::Color
- Defined in:
- lib/rubyXL/objects/color.rb
Overview
Class Method Summary collapse
-
.validate_color(color) ⇒ Object
validates hex color code, no ‘#’ allowed.
Methods inherited from OOXMLObject
define_attribute, define_child_node, define_element_name, #dup, #initialize, obtain_class_variable, parse, set_countable, #write_xml
Constructor Details
This class inherits a constructor from RubyXL::OOXMLObject
Class Method Details
.validate_color(color) ⇒ Object
validates hex color code, no ‘#’ allowed
13 14 15 16 17 18 19 |
# File 'lib/rubyXL/objects/color.rb', line 13 def self.validate_color(color) if color =~ /^([a-f]|[A-F]|[0-9]){6}$/ return true else raise 'invalid color' end end |