Skip to content

Commit

Permalink
Added a default forb iterations in earthtone
Browse files Browse the repository at this point in the history
  • Loading branch information
prjctimg committed Nov 20, 2023
1 parent e23c080 commit 2b2dffc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions build.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

// eslint-disable-next-line no-undef
var { build } = require('esbuild');

var { dependencies } = require('./package.json')


const sharedConfig = {
entryPoints: ['.//src/index.ts'],
bundle: false,
bundle: true,
minify: false
};

Expand Down Expand Up @@ -49,7 +49,6 @@ build({
format: 'esm',
entryPoints: ['.//src/colors/index.ts'],
outfile: 'dist/colors/index.esm.mjs',

});


Expand All @@ -67,8 +66,9 @@ build({
//Bundled ESM
build({
...sharedConfig,
external: Object.keys(dependencies),
format: 'esm',
outfile: 'dist/huetiful.esm.mjs', minifySyntax: true
outfile: 'dist/huetiful.esm.mjs', minifySyntax: true,

});

Expand All @@ -78,7 +78,7 @@ build({
format: 'esm',
outfile: 'dist/huetiful.esm.min.mjs',
minify: true,
bundle: true, minifySyntax: true

});

//Bundled IIFE
Expand All @@ -87,7 +87,7 @@ build({
format: 'iife',
outfile: 'dist/huetiful.min.js',
globalName: 'huetiful',
bundle: true, minifySyntax: true, minify: true
minify: true

});

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "huetiful-js",
"version": "1.7.6",
"type": "module",
"main": "./dist/huetiful.cjs",
"module": "./dist/huetiful.esm.mjs",
"browser": "./dist/huetiful.min.js",
"exports": {
Expand Down
4 changes: 2 additions & 2 deletions src/fp/array/customSort.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//@ts-nocheck
import { Factor, order } from '../../paramTypes';
import { Factor, Order } from '../../paramTypes';

/**
* @description Helper function for native sorting method for arrays.
* @param factor The property to query.
* @param order Either ascending or descending.
* @returns A sorted array.
*/
export const customSort = (order: order, factor?: Factor) => {
export const customSort = (order: Order, factor?: Factor) => {
// Special thanks to deechris27 on youtube
// a-b gives asc order & b-a gives desc order
factor = factor || 'factor';
Expand Down
4 changes: 2 additions & 2 deletions src/fp/array/sortedArr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Factor, Color, callback, order } from '../../paramTypes';
import { Factor, Color, callback, Order } from '../../paramTypes';
import { colorObjArr } from './colorObjArr';
import { customSort } from './customSort';

Expand All @@ -9,7 +9,7 @@ import { customSort } from './customSort';
* @returns An array of colors or color objects.
*/
const sortedArr =
(factor: Factor, callback: callback, order: order, colorObj = false) =>
(factor: Factor, callback: callback, order: Order, colorObj = false) =>
(colors: Color[]) => {
const results: Color[] | Array<{ factor: number; name: Color }> =
colorObjArr(factor, callback)(colors);
Expand Down
5 changes: 3 additions & 2 deletions src/palettes/earthtone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ console.log(earthtone("pink", "clay", 5))
const earthtone = (
color: Color,
earthtone?: Earthtones,
iterations = 1,
options: EarthtoneOptions
iterations?: number,
options?: EarthtoneOptions
): Color[] => {
options = {
easingFunc: easingSmootherstep,
Expand All @@ -46,6 +46,7 @@ const earthtone = (
hueFixup: fixupHueShorter,
lightnessInterpolator: interpolatorSplineMonotone
};
iterations = iterations < 1 ? 1 : iterations;
earthtone = earthtone.toLowerCase();
const tones = {
'light-gray': '#e5e5e5',
Expand Down

0 comments on commit 2b2dffc

Please sign in to comment.