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

@palett/presets

Package Overview
Dependencies
Maintainers
1
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@palett/presets - npm Package Compare versions

Comparing version 0.2.11 to 0.2.12

25

dist/index.cjs.js

@@ -6,2 +6,5 @@ 'use strict';

var cards = require('@palett/cards');
var rand = require('@aryth/rand');
var convert = require('@palett/convert');
var tonerHsl = require('@palett/toner-hsl');

@@ -116,2 +119,23 @@ const AQUA = {

const reverseHue = hue => {
hue += 180;
return hue > 360 ? hue - 360 : hue < 0 ? hue + 360 : hue;
};
const constraint = (x, min, max) => x > max ? max : x < min ? min : x;
const randPreset = hex => {
var _min, _toner, _ref;
const min = hex;
const hsl = (_min = min, convert.hexToHsl(_min));
const max = (_toner = tonerHsl.toner(hsl.slice(), rand.randIntBetw(-12, 12), rand.randIntBetw(-5, 10), rand.randIntBetw(6, 18)), convert.hslToHex(_toner));
const na = (_ref = [reverseHue(hsl[0]), constraint(hsl[1] - 32, 5, 90), constraint(hsl[2] + 24, 40, 96)], convert.hslToHex(_ref));
return {
min,
max,
na
};
};
exports.AQUA = AQUA;

@@ -130,1 +154,2 @@ exports.ATLAS = ATLAS;

exports.SUBTLE = SUBTLE;
exports.randPreset = randPreset;

26

dist/index.esm.js
import { Palett } from '@palett/cards';
import { randIntBetw } from '@aryth/rand';
import { hexToHsl, hslToHex } from '@palett/convert';
import { toner } from '@palett/toner-hsl';

@@ -111,2 +114,23 @@ const AQUA = {

export { AQUA, ATLAS, AURORA, FRESH, INSTA, JUNGLE, LAVA, METRO, OCEAN, PLANET, POME, Presets, SUBTLE };
const reverseHue = hue => {
hue += 180;
return hue > 360 ? hue - 360 : hue < 0 ? hue + 360 : hue;
};
const constraint = (x, min, max) => x > max ? max : x < min ? min : x;
const randPreset = hex => {
var _min, _toner, _ref;
const min = hex;
const hsl = (_min = min, hexToHsl(_min));
const max = (_toner = toner(hsl.slice(), randIntBetw(-12, 12), randIntBetw(-5, 10), randIntBetw(6, 18)), hslToHex(_toner));
const na = (_ref = [reverseHue(hsl[0]), constraint(hsl[1] - 32, 5, 90), constraint(hsl[2] + 24, 40, 96)], hslToHex(_ref));
return {
min,
max,
na
};
};
export { AQUA, ATLAS, AURORA, FRESH, INSTA, JUNGLE, LAVA, METRO, OCEAN, PLANET, POME, Presets, SUBTLE, randPreset };

9

package.json
{
"name": "@palett/presets",
"version": "0.2.11",
"version": "0.2.12",
"description": "A color converter",

@@ -18,3 +18,6 @@ "main": "dist/index.cjs.js",

"dependencies": {
"@palett/cards": "^0.2.11"
"@aryth/rand": "^0.2.5",
"@palett/cards": "^0.2.12",
"@palett/convert": "^0.2.12",
"@palett/toner-hsl": "^0.2.12"
},

@@ -42,3 +45,3 @@ "repository": {

"homepage": "https://github.com/hoyeungw/palett/presets#readme",
"gitHead": "bc5829f824fe916225e028f985a3a7ed9d364ff2"
"gitHead": "40671704dd995d641148d4ce9e9ae2de0f93e013"
}
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