Method: RubyXL::ColorConvenienceClasses::HlsColor#apply_tint

Defined in:
lib/rubyXL/convenience_methods/color.rb

#apply_tint(tint) ⇒ Object


140
141
142
143
144
145
146
147
148
149
150
# File 'lib/rubyXL/convenience_methods/color.rb', line 140

def apply_tint(tint)
  return self if tint.nil? || tint == 0

  if tint < 0 then
    self.l = l * (1.0 + tint);
  else
    self.l = (l * (1.0 - tint)) + tint;
  end

  self
end