Warcraft III resources & community, 2003–2006 · archived

ColorIntegerCrossFade

not rated
Submitted by PepparVariable Change0 downloads
Cross fades the two colors, where part = 0 means that all of c1 is returned, part = 1 means that all of c2 is returned and everything in between returns a cross fade between the two.

Requires: CreateColorInteger, ColorIntegerGet

Source

function ColorIntegerCrossFade takes integer c1, integer c2, real part returns integer
    local real invpart = 1 - part
    return CreateColorInteger(R2I(I2R(ColorIntegerGetRed(c1)) * invpart + I2R(ColorIntegerGetRed(c2)) * part), R2I(I2R(ColorIntegerGetGreen(c1)) * invpart + I2R(ColorIntegerGetGreen(c2)) * part), R2I(I2R(ColorIntegerGetBlue(c1)) * invpart + I2R(ColorIntegerGetBlue(c2)) * part), R2I(I2R(ColorIntegerGetAlpha(c1)) * invpart + I2R(ColorIntegerGetAlpha(c2)) * part))
endfunction

Comments

0

No comments.