Black Trigram (흑괘) - Korean Martial Arts Combat Simulator API - v0.6.9
    Preparing search index...

    Function mixColors

    • 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.

      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

      색상혼합

      // Mix skin color with bruise color at 30%
      const skinColor = 0xffdbac;
      const bruiseColor = 0x663366;
      const damaged = mixColors(skinColor, bruiseColor, 0.3);

      // Gradually transition between colors
      const transitionColor = mixColors(startColor, endColor, progress);