Class: Uniword::Properties::ColorValue

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/uniword/properties/color_value.rb

Overview

Color value element

Represents <w:color w:val=“…” w:themeColor=“…” w:themeShade=“…”/> where value is RGB hex (e.g., “FF0000”) and themeColor references theme (e.g., “background1”) themeShade is a hex tint value (e.g., “BF”)

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

Compare with another ColorValue or a string



34
35
36
37
38
39
40
41
42
# File 'lib/uniword/properties/color_value.rb', line 34

def ==(other)
  if other.is_a?(ColorValue)
    value == other.value
  elsif other.is_a?(String)
    value == other
  else
    super
  end
end

#hashObject

For hash key compatibility



52
53
54
# File 'lib/uniword/properties/color_value.rb', line 52

def hash
  value.hash
end

#to_sObject

For string interpolation



47
48
49
# File 'lib/uniword/properties/color_value.rb', line 47

def to_s
  value.to_s
end