Function asString

  • Get a color as a string.

    Parameters

    • color: string | number

      The color value.

    Returns string

    The color as a string.

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