Function getName

  • Get the name of the nearest color in the given color name dictionary.

    Type Parameters

    Parameters

    • color: T

      The color.

    • names: Map<string, T>

      The color name dictionary.

    • diff: ((a: T, b: T) => number)

      The function for comparing the difference between colors.

        • (a, b): number
        • Parameters

          Returns number

    Returns string

    The nearest color name.