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

Add alpha channel support to <channel-slider> and <color-picker> #63

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix value precision
  • Loading branch information
DmitrySharabin committed May 22, 2024
commit 24abea86ea0b2e2204f66c8b84c049f68b1dd6d5
2 changes: 1 addition & 1 deletion src/channel-slider/channel-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export default class ChannelSlider extends NudeElement {
type: Number,
default () {
let value = this.defaultColor.get(this.channel);
return this.channel === "alpha" ? value * 100 : value;
return this.channel === "alpha" ? +(value * 100).toPrecision(4) : value;
},
reflect: {
from: "value",
Expand Down