Function asNumber

  • Get a color as a number.

    Parameters

    • color: string | number

      The color value.

    Returns number

    The color as a number.

    const num = asNumber('#ffffff')
    // num = 0xffffff
    const num = asNumber(0xffffff)
    // num = 0xffffff