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

Duplicates in Wikipedia lead to random colors #24

Open
aligator opened this issue Dec 2, 2024 · 0 comments · May be fixed by #25
Open

Duplicates in Wikipedia lead to random colors #24

aligator opened this issue Dec 2, 2024 · 0 comments · May be fixed by #25

Comments

@aligator
Copy link

aligator commented Dec 2, 2024

Hi I just wanted to build a Matrix theme and noticed a very strange behavior.

The color "Neon green" from the Wikipedia palette returned randomly two different colors when using fmt.Println(palette.Wikipedia.Filter("Neon green")[0]).

As it turns out there are two different colors defined as "Neon green".

Not sure how you would like to handle this. This problem may also happen when using palettes that are .MixedWith other palettes containing same names.

Maybe it would help to sort the colors in some way, to have a deterministic order of the colors array returned by the .Filter

I did a search for other duplicates in the Wikipedia Palette:

Duplicate color in palette.Wikipedia Peach
  {Peach {1 0.796078 0.643137} }
  {Peach {1 0.898039 0.705882} }
Duplicate color in palette.Wikipedia Tea rose
  {Tea rose {0.972549 0.513725 0.47451} }
  {Tea rose {0.956863 0.760784 0.760784} }
Duplicate color in palette.Wikipedia Vermilion
  {Vermilion {0.85098 0.219608 0.117647} }
  {Vermilion {0.890196 0.258824 0.203922} }
Duplicate color in palette.Wikipedia Midnight blue
  {Midnight blue {0 0.27451 0.54902} }
  {Midnight blue {0.098039 0.098039 0.439216} }
Duplicate color in palette.Wikipedia Bronze
  {Bronze {0.803922 0.498039 0.196078} }
  {Bronze {0.533333 0.329412 0.043137} }
Duplicate color in palette.Wikipedia Royal red
  {Royal red {0.607843 0.109804 0.192157} }
  {Royal red {0.815686 0 0.376471} }
Duplicate color in palette.Wikipedia Dark imperial blue
  {Dark imperial blue {0 0.078431 0.494118} }
  {Dark imperial blue {0 0.254902 0.415686} }
Duplicate color in palette.Wikipedia Violet-red
  {Violet-red {0.537255 0.078431 0.27451} }
  {Violet-red {0.968627 0.32549 0.580392} }
Duplicate color in palette.Wikipedia Neon green
  {Neon green {0.07451 0.607843 0.258824} }
  {Neon green {0.223529 1 0.078431} }
Duplicate color in palette.Wikipedia Royal blue
  {Royal blue {0 0.137255 0.4} }
  {Royal blue {0.254902 0.411765 0.882353} }
Duplicate color in palette.Wikipedia Scarlet
  {Scarlet {0.992157 0.054902 0.207843} }
  {Scarlet {1 0.141176 0} }
Duplicate color in palette.Wikipedia Lemon lime
  {Lemon lime {0.360784 1 0.403922} }
  {Lemon lime {0.890196 1 0} }
Duplicate color in palette.Wikipedia Chinese red
  {Chinese red {0.803922 0.027451 0.117647} }
  {Chinese red {0.666667 0.219608 0.117647} }
@aligator aligator changed the title Duplicates lead to random colors Duplicates in Wikipedia lead to random colors Dec 2, 2024
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

Successfully merging a pull request may close this issue.

1 participant