Socket
Socket
Sign inDemoInstall

adaptive-gradient

Package Overview
Dependencies
2
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

26

index.js
var convert = require('color-convert');
module.exports = {
default: function(hex) {
var hsl = convert.hex.hsl(hex);
var h = (hsl[0] - 25 + 360) % 360;
var s = Math.min(Math.max(hsl[1] - 20, 50), 100);
var l = Math.min(Math.max(hsl[2] + 10, 0), 100);
exports.default = function(hex) {
var hsl = convert.hex.hsl(hex);
var h = (hsl[0] - 25 + 360) % 360;
var s = Math.min(Math.max(hsl[1] - 20, 50), 100);
var l = Math.min(Math.max(hsl[2] + 10, 0), 100);
var rgb = convert.hex.rgb(hex);
var brightness = Math.sqrt(Math.pow(rgb[0], 2) * .299 + Math.pow(rgb[1], 2) * .587 + Math.pow(rgb[2], 2) * .114);
var rgb = convert.hex.rgb(hex);
var brightness = Math.sqrt(Math.pow(rgb[0], 2) * .299 + Math.pow(rgb[1], 2) * .587 + Math.pow(rgb[2], 2) * .114);
return {
start: hex,
end: convert.hsl.hex([h, s, l]),
fontShouldBeLight: brightness < 128
};
}
return {
start: hex,
end: convert.hsl.hex([h, s, l]),
fontShouldBeLight: brightness < 128
};
};
{
"name": "adaptive-gradient",
"version": "1.0.2",
"version": "1.0.3",
"description": "A JS library to auto-suggest nice looking gradients and recommendation on font-color",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc