Skip to content

Commit

Permalink
Release v1.0.1 (#10)
Browse files Browse the repository at this point in the history
* fix(formats): 🐛 fix unsupported formats error

hex and hexa are now supported

* fix(ui): 💄 fix swatch picker bg color in hsb

* add changesets
  • Loading branch information
theskinnycoder committed May 28, 2024
1 parent 191dc82 commit d183b8c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changeset/yellow-colts-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"rangu": patch
---

- fix swatch picker bg color
- fix unsupported formats bug
8 changes: 7 additions & 1 deletion src/color-picker/ColorPicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ const ExampleColorPicker = ({ color }: { color: string }) => {
<Rangu.EyeDropper />
<Rangu.InputFields withLabels />

<span>Final Color : {value}</span>
<span
style={{
fontSize: "0.75rem",
}}
>
Final Color : {value}
</span>
</div>
</Rangu.Root>
);
Expand Down
4 changes: 2 additions & 2 deletions src/color-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ const RanguColorPicker = (props: RanguColorPickerProps) => {

// For initial render
React.useEffect(() => {
onChange(parseColor(value).toFormat(outputFormat).toString());
onChange(parseColor(value).toString(outputFormat));
}, [onChange, outputFormat, value]);

const onChangeHandler = React.useCallback(
(value: Color) => {
setColor(value);
onChange(value.toFormat(outputFormat).toString());
onChange(value.toString(outputFormat));
},
[onChange, outputFormat],
);
Expand Down
2 changes: 1 addition & 1 deletion src/swatch-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const RanguSwatchPicker = React.forwardRef<
"transition-transform duration-300 ease-in-out",
)}
style={{
backgroundColor: color.toString(outputFormat),
backgroundColor: color.toString("rgba"),
borderColor: getContrastColor(color.toString(outputFormat)),
}}
>
Expand Down

0 comments on commit d183b8c

Please sign in to comment.