lib/iron/web/color.rb
def blend(other, amt)
    other = Color.parse(other)
    return Color.new(self) if amt <= 0 || other.nil?
    return Color.new(other) if amt >= 1.0
    val = Color.new(self)
    val.r += ((other.r - val.r)*amt).to_i
    val.g += ((other.g - val.g)*amt).to_i
    val.b += ((other.b - val.b)*amt).to_i
    val
  end
# Blend to a color amt % towards another color value
Blend to a color amt % towards another color value
Blend to a color amt % towards another color value
def blend(other, amt)
    other = Color.parse(other)
    return Color.new(self) if amt <= 0 || other.nil?
    return Color.new(other) if amt >= 1.0
    val = Color.new(self)
    val.r += ((other.r - val.r)*amt).to_i
    val.g += ((other.g - val.g)*amt).to_i
    val.b += ((other.b - val.b)*amt).to_i
    val
  end
def blend ( other , amt ) other = Color . parse ( other ) return Color . new ( self ) if amt <= 0 || other . nil? return Color . new ( other ) if amt >= 1.0 val = Color . new ( self ) val . r += ( ( other . r - val . r ) * amt ) . to_i val . g += ( ( other . g - val . g ) * amt ) . to_i val . b += ( ( other . b - val . b ) * amt ) . to_i val end
Blend to a color amt % towards another color value
Blend to a color amt % towards another color value
other
amt