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

rework

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rework - npm Package Compare versions

Comparing version 0.18.0 to 0.18.1

5

component.json
{
"name": "rework",
"version": "0.18.0",
"version": "0.18.1",
"description": "CSS manipulations built on CSSOM",

@@ -12,3 +12,4 @@ "keywords": ["css", "manipulation", "preprocess", "transform"],

"component/path": "1.0.0",
"jonathanong/rework-inherit": "0.1.5"
"jonathanong/rework-inherit": "0.1.5",
"jankuca/hsb2rgb": "1.0.2"
},

@@ -15,0 +16,0 @@ "scripts": [

0.18.1 / 2013-09-03
==================
* extract hsb2rgb() as a separate npm module
0.18.0 / 2013-09-02

@@ -3,0 +8,0 @@ ==================

41

lib/plugins/colors.js

@@ -7,2 +7,3 @@

var parse = require('color-parser');
var hsb2rgb = require('hsb2rgb');
var functions = require('./function');

@@ -73,41 +74,1 @@

};
/**
* HSB conversion.
*/
function hsb2rgb(hue, saturation, value) {
hue = (parseInt(hue, 10) || 0) % 360;
saturation = /%/.test(saturation)
? parseInt(saturation, 10) / 100
: parseFloat(saturation, 10);
value = /%/.test(value)
? parseInt(value, 10) / 100
: parseFloat(value, 10);
var rgb;
if (0 == saturation) return [value, value, value];
var side = hue / 60;
var chroma = value * saturation;
var x = chroma * (1 - Math.abs(side % 2 - 1));
var match = value - chroma;
switch (Math.floor(side)) {
case 0: rgb = [chroma, x, 0]; break;
case 1: rgb = [x, chroma, 0]; break;
case 2: rgb = [0, chroma, x]; break;
case 3: rgb = [0, x, chroma]; break;
case 4: rgb = [x, 0, chroma]; break;
case 5: rgb = [chroma, 0, x]; break;
default: rgb = [0, 0, 0];
}
rgb[0] = Math.round(255 * (rgb[0] + match));
rgb[1] = Math.round(255 * (rgb[1] + match));
rgb[2] = Math.round(255 * (rgb[2] + match));
return rgb;
}
{
"name": "rework",
"version": "0.18.0",
"version": "0.18.1",
"description": "CSS manipulations built on CSSOM",

@@ -15,2 +15,3 @@ "keywords": ["css", "manipulation", "preprocess", "transform"],

"color-parser": "0.1.0",
"hsb2rgb": "1.0.2",
"mime": "1.2.9",

@@ -17,0 +18,0 @@ "debug": "*",

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