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

carto

Package Overview
Dependencies
Maintainers
41
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

carto - npm Package Compare versions

Comparing version 0.16.1 to 0.16.2

4

CHANGELOG.md
## Changelog
## 0.16.2
* Fixed a regression related to color math ([#443](https://github.com/mapbox/carto/issues/443))
## 0.16.1

@@ -4,0 +8,0 @@

var chroma = require('chroma-js'),
husl = require('husl');
husl = require('husl'),
_ = require('lodash');

@@ -95,3 +96,3 @@ (function(tree) {

// Operations have to be done per-channel, if not,
// Operations have to be done in RGB per-channel, if not,
// channels will spill onto each other. Once we have

@@ -107,5 +108,25 @@ // our result, in the form of an integer triplet,

var normalize = function (x) {
return x / 255;
};
var denormalize = function (x) {
return x * 255;
};
var rgb1 = _.map(chroma(this.toString()).rgb(), normalize);
var rgb2 = _.map(chroma(other.toString()).rgb(), normalize);
for (var c = 0; c < 3; c++) {
result[c] = tree.operate(op, this.hsl[c], other.hsl[c]);
result[c] = tree.operate(op, rgb1[c] , rgb2[c]);
}
if (this.perceptual) {
result = husl.fromRGB.apply(this, result);
result[1] = result[1] / 100;
result[2] = result[2] / 100;
}
else {
result = chroma(_.map(result, denormalize)).hsl();
}
return new tree.Color(result, this.alpha, this.perceptual);

@@ -112,0 +133,0 @@ },

2

package.json
{
"name": "carto",
"version": "0.16.1",
"version": "0.16.2",
"description": "Mapnik Stylesheet Compiler",

@@ -5,0 +5,0 @@ "url": "https://github.com/mapbox/carto",

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