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

contrast-color

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contrast-color - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json

@@ -7,3 +7,3 @@ {

"repository": "busterc/contrast-color",
"version": "1.0.0",
"version": "1.0.1",
"main": "lib/index.js",

@@ -10,0 +10,0 @@ "files": [

@@ -23,21 +23,18 @@ # contrast-color [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]

const ContrastColor = require('contrast-color');
const cc = ContrastColor({
bgColor: 'navy',
fgDarkColor: 'water',
fgLightColor: 'navy',
fgDarkColor: '#0570E3',
const cc = new ContrastColor({
bgColor: "navy",
fgDarkColor: "navy",
fgLightColor: "water",
customNamedColors: {
water: '#00D0FF'
}
water: "#00D0FF",
},
});
const defaultFgColor = cc.contrastColor();
const inverseFgColor = cc.contrastColor({ bgColor: 'water' });
const hasAquaBgColor = cc.contrastColor({ bgColor: 'aqua' });
const hasAquaBgColor = cc.contrastColor({ bgColor: "aqua" });
/* Results
{
defaultFgColor: '#000080',
inverseFgColor: '#0570E3',
hasAquaBgColor: '#0570E3'
defaultFgColor: '#00D0FF', // water
hasAquaBgColor: '#000080' // navy
}

@@ -69,8 +66,8 @@ */

{
hasRedBg: '#FFFFFF',
hasRedBgWithBlackFg: '#000000',
hasYellowBg: '#000000',
hasWhiteBgWithGreenFg: '#008000',
hasBlackBgWithLimeFg: '#00FF00',
hasKitchenSink: '#ff99ff'
hasRedBg: '#FFFFFF', // white
hasRedBgWithBlackFg: '#000000', // black
hasYellowBg: '#000000', // black
hasWhiteBgWithGreenFg: '#008000', // green
hasBlackBgWithLimeFg: '#00FF00', // lime
hasKitchenSink: '#ff99ff' // clean
}

@@ -77,0 +74,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