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

color-space

Package Overview
Dependencies
Maintainers
6
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-space - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

0

ciecam.js

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

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

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

46

hsl.js

@@ -14,44 +14,18 @@ /**

rgb: function(hsl) {
var h = hsl[0] / 360,
s = hsl[1] / 100,
l = hsl[2] / 100,
t1, t2, t3, rgb, val;
var h = hsl[0]/360, s = hsl[1]/100, l = hsl[2]/100, t1, t2, t3, rgb, val, i=0;
if (s === 0) {
val = l * 255;
return [val, val, val];
}
if (s === 0) return val = l * 255, [val, val, val];
if (l < 0.5) {
t2 = l * (1 + s);
}
else {
t2 = l + s - l * s;
}
t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
t1 = 2 * l - t2;
rgb = [0, 0, 0];
for (var i = 0; i < 3; i++) {
for (;i<3;) {
t3 = h + 1 / 3 * - (i - 1);
if (t3 < 0) {
t3++;
}
else if (t3 > 1) {
t3--;
}
if (6 * t3 < 1) {
val = t1 + (t2 - t1) * 6 * t3;
}
else if (2 * t3 < 1) {
val = t2;
}
else if (3 * t3 < 2) {
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
}
else {
val = t1;
}
rgb[i] = val * 255;
t3 < 0 ? t3++ : t3 > 1 && t3--;
val = 6 * t3 < 1 ? t1 + (t2 - t1) * 6 * t3 :
2 * t3 < 1 ? t2 :
3 * t3 < 2 ? t1 + (t2 - t1) * (2 / 3 - t3) * 6 :
t1;
rgb[i++] = val * 255;
}

@@ -58,0 +32,0 @@

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

{
"name": "color-space",
"description": "Collection of color space conversions",
"version": "2.0.0",
"version": "2.0.1",
"author": "Dmitry Ivanov <df.creative@gmail.com>",

@@ -6,0 +6,0 @@ "type": "module",

@@ -0,0 +0,0 @@ # Color-space [![test](https://github.com/colorjs/color-space/actions/workflows/test.yml/badge.svg)](https://github.com/colorjs/color-space/actions/workflows/test.yml) [![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)](http://github.com/badges/stability-badges) [![npm](https://img.shields.io/npm/v/color-space)](https://npmjs.org/color-space) [![size](https://img.shields.io/bundlephobia/minzip/color-space/latest)](https://bundlephobia.com/package/color-space)

@@ -0,0 +0,0 @@ /**

@@ -15,3 +15,4 @@ /**

max: [1, 1, 1],
channel: ['tint','saturation','lightness']
channel: ['tint','saturation','lightness'],
alias: ['TSL'],
};

@@ -72,16 +73,11 @@

rgb.tsl = function(rgb) {
var r = rgb[0] / 255,
g = rgb[1] / 255,
b = rgb[2] / 255;
var [r, g, b] = rgb;
var r_ = (r / (r + g + b) || 0) - 1/3,
g_ = (g / (r + g + b) || 0) - 1/3;
var T = g_ > 0 ? .5 * Math.atan(r_/ g_) / Math.PI + .25 :
g_ < 0 ? .5 * Math.atan(r_/ g_) / Math.PI + .75 : 0;
g_ = (g / (r + g + b) || 0) - 1/3,
T = g_ != 0 ? 0.5 - Math.atan2(g_, r_) / 2 / Math.PI : 0,
S = Math.sqrt(9/5 * (r_*r_ + g_*g_)),
L = ((r * 0.299) + (g * 0.587) + (b * 0.114)) / 255;
var S = Math.sqrt(9/5 * (r_*r_ + g_*g_));
var L = (r * 0.299) + (g * 0.587) + (b * 0.114);
return [T, S, L];
};

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

Sorry, the diff of this file is too big to display

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