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

react-best-gradient-color-picker

Package Overview
Dependencies
Maintainers
1
Versions
224
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-best-gradient-color-picker - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

8

lib/context.js

@@ -24,4 +24,4 @@ import React, { createContext, useContext, useState, useEffect } from 'react';

const [selectedColor, setSelectedColor] = useState(0);
const initials = getInitialValues(colors, selectedColor);
const [color, setColor] = useState(initials?.c);
const initials = getInitialValues(colors, selectedColor); // const [color, setColor] = useState(initials?.c)
const [hue, setHue] = useState(initials?.h);

@@ -52,7 +52,5 @@ const [hueX, setHueX] = useState(initials?.hx);

if (newGrad?.includes('gradient')) {
setColor(newGrad);
onChange(newGrad);
}
} else {
setColor(newColor);
onChange(newColor);

@@ -104,3 +102,3 @@ }

colors.push({
value: color,
value: '',
left: left / 2.8,

@@ -107,0 +105,0 @@ opacity: 100,

{
"name": "react-best-gradient-color-picker",
"version": "1.0.8",
"version": "1.0.9",
"description": "An easy to use color/gradient picker for React.js",

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

@@ -18,3 +18,3 @@ import React, { createContext, useContext, useState, useEffect } from 'react';

const initials = getInitialValues(colors, selectedColor)
const [color, setColor] = useState(initials?.c)
// const [color, setColor] = useState(initials?.c)
const [hue, setHue] = useState(initials?.h)

@@ -40,7 +40,5 @@ const [hueX, setHueX] = useState(initials?.hx)

if (newGrad?.includes('gradient')) {
setColor(newGrad)
onChange(newGrad)
}
} else {
setColor(newColor)
onChange(newColor)

@@ -91,3 +89,3 @@ }

let left = computeBarPosition(e, offsetLeft)
colors.push({value: color, left: left / 2.8, opacity: 100, hsl: hsl })
colors.push({value: '', left: left / 2.8, opacity: 100, hsl: hsl })
handleSelectedColor(e, newIndex)

@@ -94,0 +92,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