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

colormin

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colormin - npm Package Compare versions

Comparing version 1.0.7 to 1.1.0

4

dist/index.js

@@ -41,2 +41,4 @@ 'use strict';

exports.default = function (colour) {
var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
if (ctype.isRGBorHSL(colour)) {

@@ -55,3 +57,3 @@ var c = undefined;

var rgb = c.rgb();
if (!rgb.r && !rgb.g && !rgb.b && !rgb.a) {
if (!opts.legacy && !rgb.r && !rgb.g && !rgb.b && !rgb.a) {
return 'transparent';

@@ -58,0 +60,0 @@ }

{
"name": "colormin",
"version": "1.0.7",
"version": "1.1.0",
"description": "Turn a CSS color into its smallest representation.",

@@ -11,5 +11,5 @@ "main": "dist/index.js",

"scripts": {
"lint": "eslint src",
"prepublish": "de dist && babel src --out-dir dist --ignore /__tests__/",
"test": "npm run lint && babel src --out-dir dist && ava dist/__tests__"
"pretest": "eslint src",
"prepublish": "del-cli dist && babel src --out-dir dist --ignore /__tests__/",
"test": "ava src/__tests__"
},

@@ -35,12 +35,20 @@ "homepage": "https://github.com/ben-eb/colormin",

"devDependencies": {
"ava": "^0.9.0",
"ava": "^0.12.0",
"babel-cli": "^6.3.17",
"babel-core": "^6.3.26",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-preset-es2015-loose": "^6.1.4",
"babel-preset-es2015": "^6.3.13",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-stage-0": "^6.3.13",
"del-cli": "^0.1.2",
"eslint": "^1.10.3"
"del-cli": "^0.2.0",
"eslint": "^2.1.0",
"eslint-config-cssnano": "^2.0.0"
},
"repository": "ben-eb/colormin"
"repository": "ben-eb/colormin",
"eslintConfig": {
"extends": "cssnano"
},
"ava": {
"require": "babel-core/register"
}
}

@@ -28,2 +28,23 @@ # colormin [![Build Status](https://travis-ci.org/ben-eb/colormin.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/colormin.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/colormin.svg)][deps]

## API
### colormin(color, [options])
#### color
Type: `string`
The color to minify.
#### options
##### legacy
Type: `boolean`
Default: `false`
Set this to `true` to enable IE < 10 compatibility; the browser chokes on the
`transparent` keyword, so in this mode the conversion from `rgba(0,0,0,0)`
is turned off.
## Contributing

@@ -30,0 +51,0 @@

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