KyoriPowered / adventure

A user-interface library, formerly known as text, for Minecraft: Java Edition
https://docs.advntr.dev/
MIT License
678 stars 103 forks source link

Adventure weighs hue too heavily when comparing colors #1077

Open jtJava opened 1 month ago

jtJava commented 1 month ago

https://github.com/KyoriPowered/adventure/blob/5919a354d6721241fc39ddb9fe9390df8d2e427d/api/src/main/java/net/kyori/adventure/text/format/TextColorImpl.java#L71

The distance method when comparing two colors causes a color like #f6fff5 (white with very slight green tint) to be downsampled to green instead of white.

zml2008 commented 1 month ago

tbh not a priority for us to look into, since downsampling is rarely used outside of super legacy situations, but PRs are welcome (with visual comparisons)

jtJava commented 1 month ago

I'm writing code for the latest version of Paper, I'd like to make use of modern colors while still allowing legacy clients to be able to play my server without seeing god awful color translation.

What do you need to see in the pull request? Is this not as simple as just removing the multiplication by three?

zml2008 commented 1 month ago

legacy clients are at the bottom of our priority list these days, it's 2024