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

@palett/convert

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@palett/convert - npm Package Compare versions

Comparing version 0.1.7 to 0.2.0

34

dist/index.cjs.js

@@ -16,17 +16,2 @@ 'use strict';

const hue = (r, g, b, max, dif) => {
if (dif === 0) return 0;
switch (max) {
case r:
return ((g - b) / dif + (g < b ? 6 : 0)) % 6;
case g:
return (b - r) / dif + 2;
case b:
return (r - g) / dif + 4;
}
};
const bound = ([r, g, b]) => {

@@ -51,3 +36,18 @@ let ma = r,

const THSD = 1000;
const hue = (r, g, b, max, dif) => {
if (dif === 0) return 0;
switch (max) {
case r:
return ((g - b) / dif + (g < b ? 6 : 0)) % 6;
case g:
return (b - r) / dif + 2;
case b:
return (r - g) / dif + 4;
}
};
const THOUSAND = 1000;
/**

@@ -73,3 +73,3 @@ * !dif: dif===0

l = sum / 2;
return [aryth.round(h), aryth.round(s * THSD) / 10, aryth.round(l * THSD) / 10];
return [aryth.round(h), aryth.round(s * THOUSAND) / 10, aryth.round(l * THOUSAND) / 10];
}

@@ -76,0 +76,0 @@

@@ -12,17 +12,2 @@ import { round } from 'aryth';

const hue = (r, g, b, max, dif) => {
if (dif === 0) return 0;
switch (max) {
case r:
return ((g - b) / dif + (g < b ? 6 : 0)) % 6;
case g:
return (b - r) / dif + 2;
case b:
return (r - g) / dif + 4;
}
};
const bound = ([r, g, b]) => {

@@ -47,3 +32,18 @@ let ma = r,

const THSD = 1000;
const hue = (r, g, b, max, dif) => {
if (dif === 0) return 0;
switch (max) {
case r:
return ((g - b) / dif + (g < b ? 6 : 0)) % 6;
case g:
return (b - r) / dif + 2;
case b:
return (r - g) / dif + 4;
}
};
const THOUSAND = 1000;
/**

@@ -69,3 +69,3 @@ * !dif: dif===0

l = sum / 2;
return [round(h), round(s * THSD) / 10, round(l * THSD) / 10];
return [round(h), round(s * THOUSAND) / 10, round(l * THOUSAND) / 10];
}

@@ -72,0 +72,0 @@

{
"name": "@palett/convert",
"version": "0.1.7",
"version": "0.2.0",
"description": "A color converter among RGB, HEX and HSL.",

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

"homepage": "https://github.com/hoyeungw/palett/rgb#readme",
"gitHead": "08919265b1eb16e7de3219b0d1c45c680f91ca5d"
"gitHead": "acea3e999df4d67303b6d04c7b713849a943b74c"
}

@@ -0,0 +0,0 @@ ## @palett/convert

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