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

Colors are sometimes ordered in reverse #3

Closed
Krule opened this issue Apr 7, 2016 · 0 comments
Closed

Colors are sometimes ordered in reverse #3

Krule opened this issue Apr 7, 2016 · 0 comments

Comments

@Krule
Copy link

Krule commented Apr 7, 2016

Example:

irb(main):001:0> require 'color_sort';
irb(main):002:0* c1 = ["#0000ff", "#a52a2a", "#ffff00", "#808080", "#008000", "#ffa500", "#ffc0cb", "#ff0000", "#000000", "#ffffff"];
irb(main):003:0* c2 = ["#2b292e", "#0000ff", "#a52a2a", "#ffff00", "#808080", "#008000", "#ffa500", "#ffc0cb", "#ff0000", "#000000", "#ffffff"];
irb(main):004:0* ColorSort.sort(c1)
=> ["#0000ff", "#000000", "#a52a2a", "#ff0000", "#808080", "#008000", "#ffff00", "#ffa500", "#ffffff", "#ffc0cb"]
irb(main):005:0> ColorSort.sort(c2)
=> ["#ffc0cb", "#ffffff", "#ffa500", "#ffff00", "#008000", "#808080", "#ff0000", "#a52a2a", "#2b292e", "#000000", "#0000ff"]
irb(main):006:0> c2 - c1
=> ["#2b292e"]

As it can be seen, there is a single color difference between two array, but colors are sorted in different order.

@Krule Krule closed this as completed May 8, 2017
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

1 participant