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

color-tf

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-tf - npm Package Compare versions

Comparing version 5.0.0-beta1 to 5.0.0

cjs/fns.js

13

package.json
{
"name": "color-tf",
"version": "5.0.0-beta1",
"version": "5.0.0",
"description": "RGB, HSL, HSV, HWB and more color models convertor",
"main": "dist/cjs/proxy",
"browser": "dist/umd.js",
"module": "dist/es/proxy",
"main": "proxy",
"browser": "umd.js",
"module": "src/proxy",
"scripts": {
"test": "babel-node --presets @babel/env test/index.spec",
"prepare": "npx rollup -c"
"rollup": "NODE_ENV=rollup npx rollup -c",
"pack": "npx babel --out-dir dist --source-type module src && npm run rollup && cp package.json dist/ && cp README.md dist/ && cp -r src dist/",
"pub": "npm run pack && npm publish dist"
},

@@ -32,2 +34,3 @@ "repository": {

"devDependencies": {
"@babel/cli": "^7.0.0-beta.46",
"@babel/core": "^7.0.0-beta.46",

@@ -34,0 +37,0 @@ "@babel/node": "^7.0.0-beta.46",

@@ -14,9 +14,11 @@ ## Color transforms between RGB, HSL, HSV and HWB, and more

The default export is a proxy, there are alse [direct functions](https://unpkg.com/color-tf@5.0.0-beta2/src/) available
### Usage
```js
import { hslToRgb, hsvToHex } from 'color-tf';
import colorTf from 'color-tf';
import hsl2hsv from 'color-tf/hsl2hsv';
hslToRgb(200, 95, 62); // [ 66, 189, 250 ]
hsvToHex(200, 95, 62); // '086c9e'
colorTf.hslToRgb(200, 95, 62); // [ 66, 189, 250 ]
```

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

import * as lib from './fns/index';
import * as lib from './fns';

@@ -52,3 +52,4 @@ import * as libHex from './hex';

get: (map, key) => {
console.log('get', key);
if (typeof key !== 'string') return map;
if (map.has(key)) return map.get(key);

@@ -67,6 +68,5 @@

fn = funcs.reduceRight((func, f) => (...a) => f(...func(...a)));
console.log('get path', fromKey, toKey, path, fn);
map.set(k, fn);
}
if (k[3] === '2') return fn;
if (key[3] === '2') return fn;

@@ -73,0 +73,0 @@ const K = fromKey + 'To' + toKey[0].toUpperCase() + toKey.slice(1);

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