module RubyXL::ColorConvenienceMethods

Public Instance Methods

get_rgb(workbook) click to toggle source
# File lib/rubyXL/convenience_methods/color.rb, line 3
def get_rgb(workbook)
  if rgb then
    return rgb
  elsif theme then
    theme_color = workbook.theme.get_theme_color(theme)
    rgb_color = theme_color && theme_color.a_srgb_clr
    color_value = rgb_color && rgb_color.val
    return nil if color_value.nil?

    RubyXL::RgbColor.parse(color_value).to_hls.apply_tint(tint).to_rgb.to_s
  end
end