Hosanna UI API v2.3.0-next
    Preparing search index...
    • Converts various color formats to a standard RGB number for animation interpolation.

      Handles multiple color input formats:

      • Hex color strings: "#FF0000", "FF0000" → 0xFF0000
      • Regular RGB numbers: 0xFF0000, 16711680 → 0xFF0000
      • AARRGGBB integers from Roku: Both positive and negative values due to 32-bit overflow

      AARRGGBB format is a 32-bit color value (AABBGGRR) used by Roku/BrightScript. Large values may appear negative in JavaScript due to signed integer overflow.

      Parameters

      • value: unknown

        The color value to convert (string, number, or unknown)

      Returns undefined | number

      RGB number (0xRRGGBB) or undefined if not a valid color

      toColorNumber("#FF0000") // → 0xFF0000 (red)
      toColorNumber("00FF00") // → 0x00FF00 (green)
      toColorNumber(0x0000FF) // → 0x0000FF (blue)
      toColorNumber(-65536) // → 0xFFFF00 (yellow from AARRGGBB overflow)