
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
react-color-palette-picker
Advanced tools
React Color Picker Component written in typescript.
npm install react-color-palette-picker
yarn add react-color-palette-picker
<!-- ColorConverter -->
<script
crossorigin="anonymous"
src="https://unpkg.com/@wilfredlopez/color-converter@1.0.8/dist/index.umd.js"
></script>
<!-- ReactColorPicker -->
<script src="https://unpkg.com/react-color-palette-picker@latest/build/index.umd.js"></script>
interface ColorPickerProps {
/**
* The width of the color picker.
*/
width?: number
/**
* The height of the color picker.
*/
height?: number
/**
* Color in the `ColorConverter` or color string.
* @type { ColorConverter } ColorConverter `https://www.npmjs.com/package/@wilfredlopez/color-converter`
*/
color?: string | ColorConverter
/**
* The function that accepts the updated `color` and a `colorConverter` as arguments.
* @ColorConverter `https://www.npmjs.com/package/@wilfredlopez/color-converter`
*/
onChange?: (color: string, convertedColor: ColorConverter) => void
/**
* classNames to override the defaults
*/
pickerClasses?: ColorPickerClasses
/**
* Show or hide the hex and rgb inputs.
*/
hideControls?: boolean
}
interface ColorPickerClasses {
container?: string
controlsContainer?: string
saturation?: {
container?: string
saturationCursor?: string
canvas?: string
}
hueBar?: {
container?: string
cursorClass?: string
}
fields?: {
container?: string
inputs?: string
}
}
USE
import { render } from 'react-dom'
import { useState } from 'react'
import { ReactColorPicker } from 'react-color-palette-picker'
//peer-dependency
import { ColorConverter } from '@wilfredlopez/color-converter'
//Default Styles or use your own by providing prop `pickerClasses`
import 'react-color-palette-picker/build/index.css'
function App() {
const [color, setColor] = useState('red')
const [allColors, setAllColors] = useState<ColorConverter[]>([])
return (
<div>
<h1 style={{ textAlign: 'center' }}>React Color Picker</h1>
<ReactColorPicker
width={400}
height={250}
color={color}
onChange={(color, colorConverter) => {
setColor(color)
setAllColors(colorConverter.all())
console.log(colorConverter.toColorObject())
}}
/>
<p style={{ textAlign: 'center' }}>{color}</p>
<div style={{ textAlign: 'center', maxWidth: 400, margin: 'auto' }}>
{allColors.map(c => {
return (
<div
style={{
background: `#${c.hex}`,
color: c.getContrast().hexString(),
}}
key={c.hex}
>
#{c.hex}
</div>
)
})}
</div>
</div>
)
}
render(<App />, document.getElementById('root'))
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<!-- STYLES -->
<link
rel="stylesheet"
href="https://unpkg.com/react-color-palette-picker@latest/build/index.css"
/>
<body>
<div id="root"></div>
<!-- React, ReactDOM -->
<script
crossorigin="anonymous"
src="https://unpkg.com/react@latest/umd/react.production.min.js"
></script>
<script
crossorigin="anonymous"
src="https://unpkg.com/react-dom@latest/umd/react-dom.production.min.js"
></script>
<!-- ColorConverter -->
<script
crossorigin="anonymous"
src="https://unpkg.com/@wilfredlopez/color-converter@1.0.8/dist/index.umd.js"
></script>
<!-- ReactColorPicker -->
<script src="https://unpkg.com/react-color-palette-picker@latest/build/index.umd.js"></script>
<script>
const ReactColorPicker = window.ReactColorPicker
const RootElement = document.getElementById('root')
ReactDOM.render(React.createElement(ReactColorPicker), RootElement)
</script>
</body>
</html>
FAQs
React Color Picker Component written in typescript.
We found that react-color-palette-picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.