Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

make-color-more-chill

Package Overview
Dependencies
Maintainers
6
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

make-color-more-chill - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

12

dist/make-color-more-chill.cjs.development.js

@@ -19,5 +19,13 @@ 'use strict';

var lighten = function lighten(color, hslPercent) {
return color.set('hsl.l', color.get('hsl.l') + hslPercent);
};
var darken = function darken(color, hslPercent) {
return lighten(color, -hslPercent);
};
function incrementChillness(color, theme) {
var slightlyChillerColor = theme === Theme["enum"].dark ? c(color).brighten(0.02) : c(color).darken(0.02);
return slightlyChillerColor.saturate(0.02).hex();
var slightlyChillerColor = theme === Theme["enum"].dark ? lighten(c(color), 0.02) : darken(c(color), 0.02);
return slightlyChillerColor.saturate(0.04).hex();
}

@@ -24,0 +32,0 @@

2

dist/make-color-more-chill.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r,t=(e=require("chroma-js"))&&"object"==typeof e&&"default"in e?e.default:e,n=require("zod"),u="#ffffff",i=n.enum(["dark","light"]),o=((r={})[i.enum.dark]="#525B66",r[i.enum.light]="#25292E",r);function a(e,r){return(r===i.enum.dark?t(e).brighten(.02):t(e).darken(.02)).saturate(.02).hex()}function f(e){return"#000000"===t(e).hex()||t(e).hex()===u}function s(e,r){return void 0===r&&(r=u),Number(t.contrast(e,r).toFixed(2))>2.5}exports.Theme=i,exports.black="#000000",exports.default=function(e,r){void 0===r&&(r=u);var n=t.distance(u,r)>t.distance("#000000",r)?i.enum.dark:i.enum.light;if(f(e))return o[n];if(s(e,r))return e;for(var d=e;!s(d,r);)d=a(d,n);return d},exports.fallbackColors=o,exports.isBlackOrWhite=f,exports.isChill=s,exports.white=u;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r,t=(e=require("chroma-js"))&&"object"==typeof e&&"default"in e?e.default:e,n=require("zod"),u="#ffffff",o=n.enum(["dark","light"]),i=((r={})[o.enum.dark]="#525B66",r[o.enum.light]="#25292E",r),s=function(e,r){return e.set("hsl.l",e.get("hsl.l")+r)};function a(e,r){return(r===o.enum.dark?s(t(e),.02):function(e,r){return s(e,-.02)}(t(e))).saturate(.04).hex()}function f(e){return"#000000"===t(e).hex()||t(e).hex()===u}function l(e,r){return void 0===r&&(r=u),Number(t.contrast(e,r).toFixed(2))>2.5}exports.Theme=o,exports.black="#000000",exports.default=function(e,r){void 0===r&&(r=u);var n=t.distance(u,r)>t.distance("#000000",r)?o.enum.dark:o.enum.light;if(f(e))return i[n];if(l(e,r))return e;for(var s=e;!l(s,r);)s=a(s,n);return s},exports.fallbackColors=i,exports.isBlackOrWhite=f,exports.isChill=l,exports.white=u;
//# sourceMappingURL=make-color-more-chill.cjs.production.min.js.map

@@ -13,5 +13,13 @@ import c from 'chroma-js';

var lighten = function lighten(color, hslPercent) {
return color.set('hsl.l', color.get('hsl.l') + hslPercent);
};
var darken = function darken(color, hslPercent) {
return lighten(color, -hslPercent);
};
function incrementChillness(color, theme) {
var slightlyChillerColor = theme === Theme["enum"].dark ? c(color).brighten(0.02) : c(color).darken(0.02);
return slightlyChillerColor.saturate(0.02).hex();
var slightlyChillerColor = theme === Theme["enum"].dark ? lighten(c(color), 0.02) : darken(c(color), 0.02);
return slightlyChillerColor.saturate(0.04).hex();
}

@@ -18,0 +26,0 @@

@@ -5,3 +5,3 @@ {

"module": "dist/make-color-more-chill.esm.js",
"version": "0.2.1",
"version": "0.2.2",
"license": "MIT",

@@ -8,0 +8,0 @@ "main": "dist/index.js",

@@ -19,7 +19,13 @@ import c from 'chroma-js';

const lighten = (color: any, hslPercent: number) =>
color.set('hsl.l', color.get('hsl.l') + hslPercent);
const darken = (color: any, hslPercent: number) => lighten(color, -hslPercent);
function incrementChillness(color: string, theme: ThemeType) {
const slightlyChillerColor =
theme === Theme.enum.dark ? c(color).brighten(0.02) : c(color).darken(0.02);
theme === Theme.enum.dark
? lighten(c(color), 0.02)
: darken(c(color), 0.02);
return slightlyChillerColor.saturate(0.02).hex();
return slightlyChillerColor.saturate(0.04).hex();
}

@@ -26,0 +32,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc