outl1ne / nova-color-field

A Laravel Nova package that adds a color picker to Nova's arsenal of fields.
MIT License
25 stars 13 forks source link

Alpha channel not working properly using `hex8` mode in Nova 3 (v `1.2`) #12

Closed reppair closed 2 years ago

reppair commented 2 years ago

Hi there.

I am having issues using the alpha channel in either hex8 or rgba mode using version 1.2.2 of the package. Not sure if the problem is also present in v2 and Nova 4.

HEX8 mode (#rrggbbAA notation)

Using Color::make('hex8')->chrome()->displayAs('hex8')->saveAs('hex8') - picked example color #6657aa94

Actual Expected
Screen Shot 2022-09-15 at 15 20 48 Screen Shot 2022-09-15 at 15 22 32

Note it would be nice if the main color (the square) also is updated with the proper color after the picker is closed (or even while the color picker is open).

Related issues

Let me know what do you think. I could work on those fixes and enhancements this weekend maybe.

KasparRosin commented 2 years ago

These seem like valid issues. Pull request is more than welcome.

reppair commented 2 years ago

Will be able to look into it this week.

reppair commented 2 years ago

📅 Busy days but still on my list.

reppair commented 2 years ago

The rendering of the color as rgba regardless of passing hex(8) to it seems to be out of scope here.

See: https://github.com/vuejs/core/issues/2998

reppair commented 2 years ago

Updated the issue to reference only the alpha problem when using hex8 and got a PR for it here #15 (for v1 - Nova 3).

Will create a separate issue for the alpha problem when using rgba since this will be harder to fix. The issue there is a bit more complicated and will require more time to fix and refactor. Maybe can give that a try when I got some free time but for now I am happy with hex8 working properly. 😺

Tarpsvo commented 2 years ago

Thanks for the PR! I merged it and released it in version 1.2.3. :)