Skip to content
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

[Bug Report][3.7.3] v-color-picker always picks the color #FFBAF255 #20847

Closed
gem-mi opened this issue Jan 7, 2025 · 4 comments
Closed

[Bug Report][3.7.3] v-color-picker always picks the color #FFBAF255 #20847

gem-mi opened this issue Jan 7, 2025 · 4 comments
Assignees
Labels
C: VColorPicker platform specific The issue only occurs on a specific platform T: bug Functionality that does not work as intended/expected
Milestone

Comments

@gem-mi
Copy link

gem-mi commented Jan 7, 2025

Environment

Vuetify Version: 3.7.3
Vue Version: 3.5.12
Browsers: Chrome 131.0.0.0, Mozilla Firefox
OS: Linux x86_64

Steps to reproduce

Click on the pipette icon and then select a color on the page.

Expected Behavior

Should display and store the selected color.

Actual Behavior

Displays and stores always #FFBAF255.

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

The same behaviour can be seen when trying out the color pickers on the documentation page: https://vuetifyjs.com/en/components/color-pickers/

@b-maslennikov
Copy link

pipette icon? can you show the screenshot? I don't have any icons

@KaelWD
Copy link
Member

KaelWD commented Jan 15, 2025

The pipette button should only be present on platforms that support the eyedropper api so I don't know why you've selected firefox, I also don't see it on linux chrome probably because of wayland's strict security model.

@KaelWD KaelWD added the S: needs reproduction The issue does not contain a valid reproduction label Jan 15, 2025
@dreamw4lker
Copy link

Tested it on Linux Mint 21.3 Cinnamon (X11 display server) on Google Chome 130.0.6723.116.

Looks like there's a problem with the EyeDropper API on X11.

I've created a simple demo with the native JS code:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>EyeDropper demo</title>
</head>
<body>
  <button id="eyedropperButton">Open eyedropper</button>
  <span id="eyedropperResult">Pick some color...</span>
  <script>
    let eyeDropper = new EyeDropper()

    document.getElementById("eyedropperButton").addEventListener('click', e => {
      eyeDropper.open()
        .then(colorSelectionResult => {
          document.getElementById('eyedropperResult').textContent = colorSelectionResult.sRGBHex
        })
    })
  </script>
</body>
</html>

When I'm picking some white cell, the result from colorSelectionResult.sRGBHex is surprisingly... rgba(255, 255, 255, 0).

According to VColorPickerPreview.tsx sources, Vuetify is trying to transform this value using HexToHSV helper function, but this function is not designed to handle RGBA values, so the result is completely wrong.

@KaelWD, the possible fix is to handle RGBA string values from native sRGBHex result. But of course it is not the Vuetify mistake.

P.S.: EyeDropper API is not available in Firefox, so the pipette button is not visible in it.

@KaelWD KaelWD added T: bug Functionality that does not work as intended/expected platform specific The issue only occurs on a specific platform C: VColorPicker and removed S: needs reproduction The issue does not contain a valid reproduction labels Jan 15, 2025
@KaelWD
Copy link
Member

KaelWD commented Jan 15, 2025

https://issuetracker.google.com/issues/352218913

Thanks for investigating @dreamw4lker, we already have a function to parse arbitrary color formats so this is a pretty easy workaround.

@KaelWD KaelWD self-assigned this Jan 15, 2025
@KaelWD KaelWD added this to the v3.7.x milestone Jan 15, 2025
@KaelWD KaelWD closed this as completed in 2e0e0f5 Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VColorPicker platform specific The issue only occurs on a specific platform T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

4 participants