Function convertHexToRgb

Converts a hex color value to RGB color format.

  • If the input value is not a valid hex color string.
  • Parameters

    • hex: string | number

      The hex color value to convert. Could be a string or a number.

    • returnArrayYn: boolean = false

      Whether to return the RGB color as an array or an object. Default is false (returns object).

    Returns any

    • The RGB color value. If returnArrayYn is true, returns an array [r, g, b]. Otherwise, returns an object {r, g, b}.