-
Notifications
You must be signed in to change notification settings - Fork 82
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
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
- Loading branch information
Showing
16 changed files
with
78 additions
and
26 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,6 @@ | ||
import distance from "../distance.js"; | ||
import getColor from "../getColor.js"; | ||
|
||
export default function deltaE76 (color, sample) { | ||
return distance(color, sample, "lab"); | ||
return distance(getColor(color), getColor(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