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

color-convert

Package Overview
Dependencies
Maintainers
3
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-convert - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

37

conversions.js

@@ -16,16 +16,29 @@ /* MIT license */

var convert = module.exports = {
rgb: {},
hsl: {},
hsv: {},
hwb: {},
cmyk: {},
xyz: {},
lab: {},
lch: {},
hex: {},
keyword: {},
ansi16: {},
ansi256: {}
rgb: {channels: 3},
hsl: {channels: 3},
hsv: {channels: 3},
hwb: {channels: 3},
cmyk: {channels: 4},
xyz: {channels: 3},
lab: {channels: 3},
lch: {channels: 3},
hex: {channels: 1},
keyword: {channels: 1},
ansi16: {channels: 1},
ansi256: {channels: 1}
};
// hide .channels property
for (var model in convert) {
if (convert.hasOwnProperty(model)) {
if (!('channels' in convert[model])) {
throw new Error('missing channels property: ' + model);
}
var channels = convert[model].channels;
delete convert[model].channels;
Object.defineProperty(convert[model], 'channels', {value: channels});
}
}
convert.rgb.hsl = function (rgb) {

@@ -32,0 +45,0 @@ var r = rgb[0] / 255;

@@ -64,2 +64,4 @@ var conversions = require('./conversions');

Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
var routes = route(fromModel);

@@ -66,0 +68,0 @@ var routeModels = Object.keys(routes);

{
"name": "color-convert",
"description": "Plain color conversion functions",
"version": "1.0.0",
"version": "1.1.0",
"author": "Heather Arthur <fayearthur@gmail.com>",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -42,3 +42,3 @@ # color-convert

Not that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.)
Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.)

@@ -45,0 +45,0 @@ ```js

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