Class: RuboCop::Formatter::HTMLFormatter::Color
- Inherits:
-
Struct
- Object
- Struct
- RuboCop::Formatter::HTMLFormatter::Color
- Defined in:
- lib/rubocop/formatter/html_formatter.rb
Instance Attribute Summary collapse
-
#alpha ⇒ Object
Returns the value of attribute alpha.
-
#blue ⇒ Object
Returns the value of attribute blue.
-
#green ⇒ Object
Returns the value of attribute green.
-
#red ⇒ Object
Returns the value of attribute red.
Instance Method Summary collapse
Instance Attribute Details
#alpha ⇒ Object
Returns the value of attribute alpha
18 19 20 |
# File 'lib/rubocop/formatter/html_formatter.rb', line 18 def alpha @alpha end |
#blue ⇒ Object
Returns the value of attribute blue
18 19 20 |
# File 'lib/rubocop/formatter/html_formatter.rb', line 18 def blue @blue end |
#green ⇒ Object
Returns the value of attribute green
18 19 20 |
# File 'lib/rubocop/formatter/html_formatter.rb', line 18 def green @green end |
#red ⇒ Object
Returns the value of attribute red
18 19 20 |
# File 'lib/rubocop/formatter/html_formatter.rb', line 18 def red @red end |
Instance Method Details
#fade_out(amount) ⇒ Object
23 24 25 26 27 |
# File 'lib/rubocop/formatter/html_formatter.rb', line 23 def fade_out(amount) dup.tap do |color| color.alpha -= amount end end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/rubocop/formatter/html_formatter.rb', line 19 def to_s "rgba(#{values.join(', ')})" end |