-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow any color type when calling individual deltaE functions (#451)
* Allow any color type when calling individual deltaE functions The types for the deltaE functions didn't allow all ColorTypes as parameters. For example, the types didn't allow "red" to be passed as a parameter. Also, calling a deletaE method with a color such as "red" would cause an exception to be thrown. e.g. let x = deltaE2000("red", "white") // Exception thrown * Pass arrays of colors to getColor()
- Loading branch information
Showing
16 changed files
with
72 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import distance from "../distance.js"; | ||
import getColor from "../getColor.js"; | ||
|
||
export default function deltaE76 (color, sample) { | ||
// Assume getColor() is called in the distance function | ||
return distance(color, sample, "lab"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import Color, { ColorObject } from "../color.js"; | ||
import { ColorTypes } from "../color.js"; | ||
export default function ( | ||
color: Color | ColorObject, | ||
sample: Color | ColorObject | ||
color: ColorTypes, | ||
sample: ColorTypes | ||
): number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import Color, { ColorObject } from "../color.js"; | ||
import { ColorTypes } from "../color.js"; | ||
export default function ( | ||
color: Color | ColorObject, | ||
sample: Color | ColorObject | ||
color: ColorTypes, | ||
sample: ColorTypes | ||
): number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import Color, { ColorObject } from "../color.js"; | ||
import { ColorTypes } from "../color.js"; | ||
export default function ( | ||
color: Color | ColorObject, | ||
sample: Color | ColorObject | ||
color: ColorTypes, | ||
sample: ColorTypes | ||
): number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import Color, { ColorObject } from "../color.js"; | ||
import { ColorTypes } from "../color.js"; | ||
export default function ( | ||
color: Color | ColorObject, | ||
sample: Color | ColorObject | ||
color: ColorTypes, | ||
sample: ColorTypes | ||
): number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import Color, { ColorObject } from "../color.js"; | ||
import { ColorTypes } from "../color.js"; | ||
export default function ( | ||
color: Color | ColorObject, | ||
sample: Color | ColorObject | ||
color: ColorTypes, | ||
sample: ColorTypes | ||
): number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters