Description

class Axlsx::Color

The color class represents a color used for borders, fills an fonts

Creates a new Color object

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • auto (Boolean)
  • rgb (String)
  • tint (Float)

Determines if the color is system color dependant

Note:

rgb colors need to conform to ST_UnsignedIntHex. That basically means put 'FF' before you color

The color as defined in rgb terms. When assigning the rgb value the behavior is much like CSS selectors and can use shorthand versions as follows: If you provide a two character value it will be repeated for each r, g, b assignment If you provide data that is not 2 characters in length, and is less than 8 characters it will be padded with “F”

Examples:

Color.new :rgb => "FF000000"
  => #<Axlsx::Color:0x102106b68 @rgb="FF000000">
Color.new :rgb => "0A"
  => #<Axlsx::Color:0x102106b68 @rgb="FF0A0A0A">
Color.new :rgb => "00BB"
  => #<Axlsx::Color:0x102106b68 @rgb="FFFF00BB">
Note:

valid values are between -1.0 and 1.0

The tint value.

Serializes the object

Parameters:

  • str (String) (defaults to: '')

Color is referenced in 0 repositories