Skip to content

Commit

Permalink
[contrast] Add re-export of src/contrast/index.js to src/index-fn.js
Browse files Browse the repository at this point in the history
  • Loading branch information
MysteryBlokHed authored and LeaVerou committed Nov 8, 2022
1 parent 288511f commit b4cadc2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/index-fn.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export {
getLuminance, setLuminance
} from "./luminance.js";
export {uv, xy} from "./chromaticity.js";
export * from "./contrast/index.js";
export {default as deltaE} from "./deltaE.js";
export * from "./deltaE/index.js";
export * from "./variations.js";
Expand Down
1 change: 1 addition & 0 deletions types/src/index-fn.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export { uv, xy } from "./chromaticity";
export { default as deltaE } from "./deltaE";
export { mix, steps, range, isRange } from "./interpolation";

export * from "./contrast/index";
export * from "./deltaE/index";
export * from "./variations";
export * from "./spaces/index-fn";
4 changes: 4 additions & 0 deletions types/test/contrast.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Color from "colorjs.io/src/color";
import contrast from "colorjs.io/src/contrast";
import { contrastAPCA } from "colorjs.io/src/index-fn";

const c1 = new Color("red");
const c2 = new Color("blue");
Expand All @@ -13,3 +14,6 @@ contrast(c1, c2);

contrast(c1, c2, "APCA"); // $ExpectType number
contrast(c1, c2, { algorithm: "APCA" }); // $ExpectType number

// Make sure that contrast methods are properly re-exported
contrastAPCA("red", "blue"); // $ExpectType number

0 comments on commit b4cadc2

Please sign in to comment.