Class: RuboCop::Formatter::HTMLFormatter::Color

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubocop/formatter/html_formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#alphaObject

Returns the value of attribute alpha

Returns:

  • (Object)

    the current value of alpha



15
16
17
# File 'lib/rubocop/formatter/html_formatter.rb', line 15

def alpha
  @alpha
end

#blueObject

Returns the value of attribute blue

Returns:

  • (Object)

    the current value of blue



15
16
17
# File 'lib/rubocop/formatter/html_formatter.rb', line 15

def blue
  @blue
end

#greenObject

Returns the value of attribute green

Returns:

  • (Object)

    the current value of green



15
16
17
# File 'lib/rubocop/formatter/html_formatter.rb', line 15

def green
  @green
end

#redObject

Returns the value of attribute red

Returns:

  • (Object)

    the current value of red



15
16
17
# File 'lib/rubocop/formatter/html_formatter.rb', line 15

def red
  @red
end

Instance Method Details

#fade_out(amount) ⇒ Object



20
21
22
# File 'lib/rubocop/formatter/html_formatter.rb', line 20

def fade_out(amount)
  dup.tap { |color| color.alpha -= amount }
end

#to_sObject



16
17
18
# File 'lib/rubocop/formatter/html_formatter.rb', line 16

def to_s
  "rgba(#{values.join(', ')})"
end