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

RGB colors does not seem right #17

Closed
tomaszgiba opened this issue Jun 29, 2016 · 2 comments
Closed

RGB colors does not seem right #17

tomaszgiba opened this issue Jun 29, 2016 · 2 comments

Comments

@tomaszgiba
Copy link

Given a color #ff7fec it has actual RGB values: R:236, G:255, B:127 (http://www.colorhexa.com/ecff7f)
However:

Paleta::Color.new(:hex, 'ff7fec')

produces this object:

#<Paleta::Color:0x007fdfe9bf8058 @blue=236, @green=127, @hex="FF7FEC", @hue=308.90625, @lightness=74.90196078, @red=255, @saturation=100.0>

which has wrong red, green, blue values: ... @blue=236, @green=127... @red=255
and it's returned wrong when to_array is used:

[25] pry(main)> Paleta::Color.new(:hex, '#ff7fec').to_array
=> [255, 127, 236]
@jordanstephens
Copy link
Owner

Hi @tomaszgiba

The link you pasted is for #ecff7f, not #ff7fec which is what you ran through paleta.

#ff7fec is definitely rgb(255, 127, 236), which is what paleta returned.

Also be careful to note that the website you are linking to shows RGB values on a 0..100 scale, whereas paleta uses a 0..255 scale.

Hope that helps!

@tomaszgiba
Copy link
Author

tomaszgiba commented Jul 4, 2016

Sorry, I was on a wild bug hunt. You are obviously right.

Thanks @jordanstephens

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