GithubHelp home page GithubHelp logo

Comments (8)

kleinfreund avatar kleinfreund commented on June 13, 2024 1

I’ve implemented a fix for this in b301c5b. It was released in package version 4.0.1.

from vue-accessible-color-picker.

kleinfreund avatar kleinfreund commented on June 13, 2024 1

@zumm Hey. Thank you for this follow-up report. I believe your issue has the same cause as what was reported in #18. After fixing that issue, opening your demo again and installing v4.0.3, I can no longer reproduce either the color jumping around in the hue slider or the copy button copying a clipped color. Would you mind trying it again? Thank you for your patience.

from vue-accessible-color-picker.

zumm avatar zumm commented on June 13, 2024

Alpha channel is still in hex property of color object of color-change event. Is it ok?

from vue-accessible-color-picker.

kleinfreund avatar kleinfreund commented on June 13, 2024

Alpha channel is still in hex property of color object of color-change event. Is it ok?

@zumm That is intentional, yes. In the color-change event, the cssColor property will have a value without alpha channel while colors in the colors property will have a value with alpha channel.

from vue-accessible-color-picker.

zumm avatar zumm commented on June 13, 2024

cssColor isn't the way for me since it respects color input mode. I want to get hex without alpha channel regardless of color input mode.

Also it seems to be broken. See that example - https://codesandbox.io/s/ancient-water-u2uvtr?file=/src/App.vue
Hex color is getting clipped.

from vue-accessible-color-picker.

kleinfreund avatar kleinfreund commented on June 13, 2024

I’ve implemented another fix for the behavior that you’re describing in a849207. It was released in package version 4.0.2.

If you always want to get hex colors without alpha channel regardless of the alpha-channel prop, you will need to apply a transformation like the following:

function handleColorChangeEvent({ colors }) {
  const hexWithoutAlphaChannel = [5, 9].includes(colors.hex.length)
    ? colors.hex.substring(0, colors.hex.length - (colors.hex.length - 1) / 4)
    : colors.hex
  console.log(hexWithoutAlphaChannel)
}

from vue-accessible-color-picker.

zumm avatar zumm commented on June 13, 2024

Yes, currently i'm using code like that to get hex without alpha channel. It is not very convenient, but ok.

New patch brings new bugs. Try to update vue-accessible-color-picker version in my previous example and select color by color-space-thumb. Hue slider goes crazy if hue isn't red.

Also i found another bug - hex code is getting clipped while copying.

from vue-accessible-color-picker.

zumm avatar zumm commented on June 13, 2024

@kleinfreund Now everything works good. Great job. Thx!

from vue-accessible-color-picker.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.