Skip to content

Commit

Permalink
Merge pull request #163 from xml-wizard/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
prjctimg authored Mar 22, 2024
2 parents 6dba1e8 + db89b85 commit 7a56a30
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 187 deletions.
2 changes: 1 addition & 1 deletion build.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// eslint-disable-next-line no-undef
var { build } = require('esbuild');
var { dependencies } = require('../../../package.json');
var { dependencies } = require('./package.json');

build({
legalComments: 'inline',
Expand Down
76 changes: 0 additions & 76 deletions demo.js

This file was deleted.

75 changes: 0 additions & 75 deletions demo/demo.js

This file was deleted.

Binary file removed demo/sample.png
Binary file not shown.
35 changes: 1 addition & 34 deletions types/colors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,6 @@ declare function getNearestColor(
num?: number
): ColorToken | Array<ColorToken> | Map<any, ColorToken>;

/**
*
* Returns the color as a simulation of the passed in `defeciencyType` of color vision deficiency with the deficiency filter's intensity determined by the `severity` value.
* @param deficiencyType The type of color vision deficiency. To avoid writing the long types, the expected parameters are simply the colors that are hard to perceive for the type of color blindness. For example those with 'tritanopia' are unable to perceive 'blue' light. Default is `'red'` when the defeciency parameter is undefined or any falsy value.
* @param color The color to return its simulated variant.
* @param severity The intensity of the filter. The exepected value is between [0,1]. For example 0.5
* @returns The color as its simulated variant. Preserves the `ColorToken` type of the pased in color.
* @example
*
* import { colorDeficiency, color2hex } from 'huetiful-js'
// Here we are simulating color blindness of tritanomaly or we can't see 'blue'.
// We are passing in our color as an array of channel values in the mode "rgb". The severity is set to 0.1
let tritanomaly = colorDeficiency('blue')
console.log(tritanomaly(['rgb', 230, 100, 50, 0.5], 0.1))
// #dd663680
// Here we are simulating color blindness of tritanomaly or we can't see 'red'. The severity is not explicitly set so it defaults to 1
let protanopia = colorDeficiency('red')
console.log(protanopia({ h: 20, w: 50, b: 30, mode: 'hwb' }))
// #9f9f9f
*/
declare function colorDeficiency(
deficiencyType?: DeficiencyType
): (color: ColorToken, severity?: number) => string;

/**
*
* A wrapper function for ColorBrewer's map of sequential color schemes.
Expand Down Expand Up @@ -151,11 +125,4 @@ declare function tailwindColors(
shade: TailwindColorFamilies | 'all',
value?: ScaleValues
): string | Array<string>;
export {
colorDeficiency,
getNearestColor,
diverging,
qualitative,
sequential,
tailwindColors
};
export { getNearestColor, diverging, qualitative, sequential, tailwindColors };
1 change: 0 additions & 1 deletion types/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
ColorToken,
HueColorSpaces,
HueFamily,
DeficiencyType,
UniformColorSpaces
} from './types';

Expand Down

0 comments on commit 7a56a30

Please sign in to comment.