@lakuna/color
    Preparing search index...

    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.

      Returns string

      The nearest color name.

      Error if the color name dictionary is empty.