Function colorToName

  • Converts a color object to its corresponding name based on the provided color dictionary.

    Parameters

    • color: Color

      The color object to be converted.

    • colors: Record<string, RGBColorObject> = HTML_COLOR_RECORD

      The dictionary containing color names and their corresponding RGB color objects.

    Returns undefined | string

    The name of the closest matching color in the dictionary, or undefined if no match is found.

Generated using TypeDoc