Performs linear interpolation between two colors using bit-shifting operations.
Useful for damage visualization, bruising effects, and color transitions.
Parameters
color1: number
First color (hex value, e.g., 0xffdbac)
color2: number
Second color (hex value, e.g., 0x663366)
ratio: number
Mix ratio (0-1, where 0 = color1, 1 = color2)
Returns number
Mixed color as hex value
Korean
색상혼합
Example
// Mix skin color with bruise color at 30% constskinColor = 0xffdbac; constbruiseColor = 0x663366; constdamaged = mixColors(skinColor, bruiseColor, 0.3);
// Gradually transition between colors consttransitionColor = mixColors(startColor, endColor, progress);
Mix two hex colors with a given ratio
Performs linear interpolation between two colors using bit-shifting operations. Useful for damage visualization, bruising effects, and color transitions.