Color icon indicating copy to clipboard operation
Color copied to clipboard

HSB not mirrored in getHex()

Open matthewaudio opened this issue 6 years ago • 3 comments

Hi, just downloaded this project and found that this code

console.log(self.color.hue(),self.color.saturation(),self.color.brightness()); console.log(self.color.getHex(),self.color.getRGB());

yields this result in the console.

0 73 52.99999999999999 #000000 rgb(0, 0, 0)

And I'm struggling to find a way that this is my bug.
I've just got 3 sliders set up setting the H,S,B of the color. Any ideas?

matthewaudio avatar Apr 14 '18 10:04 matthewaudio

honestly i haven't touched this code in years but i can check it out. are you saying you're getting back those values from a newly instantiated Color instance?

moagrius avatar Apr 16 '18 01:04 moagrius

Hey... It looks like there are some other libraries that do approximately the same thing so no worries. I could investigate myself although I don't know the math.

What I'm saying is that the two lines of code I provided are in my program as show, executed one right after another and for some reason the first line yields the appropriate values but the rgb and hex gets yield zeros.

matthewaudio avatar Apr 16 '18 10:04 matthewaudio

got it, i'll check it out (some day), thanks for the note

moagrius avatar Apr 16 '18 12:04 moagrius