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



49
50
51
# File 'lib/rubocop/formatter/html_formatter.rb', line 49

def alpha
  @alpha
end

#blueObject

Returns the value of attribute blue

Returns:

  • (Object)

    the current value of blue



49
50
51
# File 'lib/rubocop/formatter/html_formatter.rb', line 49

def blue
  @blue
end

#greenObject

Returns the value of attribute green

Returns:

  • (Object)

    the current value of green



49
50
51
# File 'lib/rubocop/formatter/html_formatter.rb', line 49

def green
  @green
end

#redObject

Returns the value of attribute red

Returns:

  • (Object)

    the current value of red



49
50
51
# File 'lib/rubocop/formatter/html_formatter.rb', line 49

def red
  @red
end

Instance Method Details

#fade_out(amount) ⇒ Object



54
55
56
57
58
# File 'lib/rubocop/formatter/html_formatter.rb', line 54

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

#to_sObject



50
51
52
# File 'lib/rubocop/formatter/html_formatter.rb', line 50

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