Skip to content

Commit

Permalink
removed range version specifiers so that stuff does'nt break
Browse files Browse the repository at this point in the history
  • Loading branch information
prjctimg committed Feb 6, 2025
1 parent 992c08b commit 017c369
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 54 deletions.
87 changes: 48 additions & 39 deletions lib/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,45 +327,54 @@ function sortBy(
* @param collection The property you want to distribute to the colors in the collection for example `hue | luminance`
* @param options Optional overrides to change the default configursation
*/
// function distribute<
// Iterable extends Collection,
// Options extends DistributionOptions,
// >(collection: Iterable, options?: Options): Collection {
// // Destructure the opts to check before distributing the factor
// let {
// extremum,
// excludeSelf,
// excludeAchromatic,
// colorspace,
// hueFixup,
// factor,
// } = or(options, {}) as Options;
// // Set the extremum to distribute to default to max if its not min
// extremum = or(extremum, "max");

// // Exclude the colorToken with the specified factor extremum being distributed
// excludeSelf = or(excludeSelf, false);

// // Exclude achromatic colors from the manipulations. The colors are returned in the resultant collection
// excludeAchromatic = or(excludeAchromatic, false);

// // The fixup to use when tweaking the hue channels
// // @ts-ignore
// hueFixup = factor === "hue"
// ? hueFixup === "longer" ? fixupHueLonger : fixupHueShorter
// : null;
// colorspace = or(colorspace, "lch");
// const facts: { [K in Factor] } = {
// hue: "h",
// lightness: mcchn("l", colorspace),
// chroma: mcchn("c", colorspace),
// distance: 0,
// luminance: 0,
// contrast: 0,
// };
// // v is expected to be a color object so that we can access the color's hue property during the mapping
// // set the callbacks depending on the type of factorStats
// }
function distribute<
Iterable extends Collection,
Options extends DistributionOptions,
>(
collection: Iterable,
options?: Options,
): Collection {
// Destructure the opts to check before distributing the factor
let {
extremum,
excludeSelf,
excludeAchromatic,
colorspace,
hueFixup,
factor,
} = or(options, {}) as Options;
// Set the extremum to distribute to default to max if its not min
extremum = or(extremum, "max");

// Exclude the colorToken with the specified factor extremum being distributed
excludeSelf = or(excludeSelf, false);

// Exclude achromatic colors from the manipulations. The colors are returned in the resultant collection
excludeAchromatic = or(
excludeAchromatic,
false,
);

// The fixup to use when tweaking the hue channels
// @ts-ignore
hueFixup =
factor === "hue"
? hueFixup === "longer"
? fixupHueLonger
: fixupHueShorter
: null;
colorspace = or(colorspace, "lch");
const facts: { [K in Factor] } = {
hue: "h",
lightness: mcchn("l", colorspace),
chroma: mcchn("c", colorspace),
distance: 0,
luminance: 0,
contrast: 0,
};
// v is expected to be a color object so that we can access the color's hue property during the mapping
// set the callbacks depending on the type of factorStats
}

/**
* Filters a collection of colors using the specified `factor` as the criterion.
Expand Down
30 changes: 15 additions & 15 deletions www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"@docusaurus/core": "3.5.2",
"@docusaurus/preset-classic": "3.5.2",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"docusaurus-lunr-search": "^3.5.0",
"prism-react-renderer": "^2.3.0",
"clsx": "2.0.0",
"docusaurus-lunr-search": "3.5.0",
"prism-react-renderer": "2.3.0",
"react": "18.0.0",
"react-dom": "18.0.0"
},
Expand All @@ -23,20 +23,20 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.5.2",
"@docusaurus/plugin-google-tag-manager": "^3.5.2",
"@docusaurus/plugin-pwa": "^3.5.2",
"@docusaurus/plugin-sitemap": "^3.5.2",
"@docusaurus/theme-search-algolia": "^3.5.2",
"@docusaurus/plugin-google-tag-manager": "3.5.2",
"@docusaurus/plugin-pwa": "3.5.2",
"@docusaurus/plugin-sitemap": "3.5.2",
"@docusaurus/theme-search-algolia": "3.5.2",
"@docusaurus/tsconfig": "3.5.2",
"@docusaurus/types": "3.5.2",
"commitizen": "^4.3.0",
"cz-emoji-conventional": "^1.0.2",
"docusaurus-plugin-typedoc": "^1.0.5",
"typedoc": "^0.26.4",
"typedoc-plugin-frontmatter": "^1.0.0",
"commitizen": "4.3.0",
"cz-emoji-conventional": "1.0.2",
"docusaurus-plugin-typedoc": "1.0.5",
"typedoc": "0.26.4",
"typedoc-plugin-frontmatter": "1.0.0",
"typedoc-plugin-markdown": "4.2.0",
"typedoc-plugin-remark": "^1.0.2",
"typescript": "~5.5.2",
"unified-prettier": "^2.0.1"
"typedoc-plugin-remark": "1.0.2",
"typescript": "5.5.2",
"unified-prettier": "2.0.1"
}
}

0 comments on commit 017c369

Please sign in to comment.