-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null/undefined color value #128
Comments
@jaywcjlove would it be against the library standard to support nullish values for the several packages? |
@Nosferatu31 like this? <Saturation
+ hsva={null}
/> |
Exactly |
Thank you for the new |
@Nosferatu31 The |
@Nosferatu31 I adjusted the |
I currently have an extra (x) button that sets the color to null. Is it possible to get this type of button inside the the swatches? like an x or something similar? Lets say that the last square in the github or compact style had an x inside it. |
@akwasin Upgrade Add clear button import React, { useState } from 'react';
import Github from '@uiw/react-color-github';
export default function Demo() {
const [hex, setHex] = useState("#fff");
return (
<>
<Github
color={hex}
style={{
'--github-background-color': '#d1eff9'
}}
onChange={(color) => {
setHex(color.hex);
}}
rectRender={(props) => {
if (props.key == 15) {
return <button key={props.key} onClick={() => setHex(null)}>x</button>
}
}}
/>
<div style={{ width: 120, height: 50, backgroundColor: hex }} />
</>
);
} |
rectRender only exists on Github style? was hoping that this was a universal thing. Im using Compact as well. |
@akwasin Upgrade |
Could Swatches support a null color swatch to unset the color?
The text was updated successfully, but these errors were encountered: