class RubyXL::Color

www.schemacentral.com/sc/ooxml/e-ssml_color-4.html

Public Class Methods

validate_color(color) click to toggle source

validates hex color code, no '#' allowed

# File lib/rubyXL/objects/color.rb, line 15
def self.validate_color(color)
  if color =~ /^([a-f]|[A-F]|[0-9]){6}$/
    return true
  else
    raise 'invalid color'
  end
end