Skip to content

Okhsl and Okhsv support for bevy_color #17650

@realhackcraft

Description

@realhackcraft

What problem does this solve or what need does it fill?

Okhsl is better than oklch at randomly generating hues while keeping other conditions equal, as it is cylindrical and therefore allows more saturation without overflowing, which is an issue with oklch.

What solution would you like?

Add okhsl and okhsv to the bevy_colors.

What alternative(s) have you considered?

  1. Deal with less saturated colors
  2. Use math on my side to calculate the highest chroma for a given hue

Additional context

C++ code can be found here: https://bottosson.github.io/posts/colorpicker/

I could try implementing this for myself, but I'm new to the codebase and don't really know how to compute some values of the traits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ColorColor spaces and color mathC-FeatureA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions