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

luminosity value of 1 in Slider swatches array breaks activeOffset() function #134

Closed
phivk opened this issue Apr 24, 2018 · 1 comment
Closed

Comments

@phivk
Copy link

phivk commented Apr 24, 2018

As I suggested in #118 I am interested in adding luminosity values of 1 (white) and 0 (black) to the swatches array in Slider.vue, like this:

swatches: ['1', '.83', '.67', '.50', '.33', '.17','0']

All displays fine, but using 1 as a value in the swatches array, breaks the functionality of the activeOffset() function that determines to which swatch the active class will be added:

activeOffset () {
  if (Math.round(this.colors.hsl.s * 100) / 100 === 0.50) {
    return Math.round(this.colors.hsl.l * 100) / 100
  }
  return 0
}

Problem seems to be that in case I select the swatch with luminosity 1, the value of this.colors.hsl.s becomes 0 and therefore activeOffset() returns 0 (thus setting the active class to the wrong swatch).

Not sure why that if statement is there in activeOffset(), but removing it fixes this issue.

@linx4200
Copy link
Collaborator

fix in v2.6.0, which will be released soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants