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

Add Support for YUV Color Models #101

Open
Chris3606 opened this issue Jan 22, 2023 · 1 comment
Open

Add Support for YUV Color Models #101

Chris3606 opened this issue Jan 22, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Chris3606
Copy link
Contributor

Chris3606 commented Jan 22, 2023

Currently, the API provided only allows you to create colors based on the RGB color model (either by specifying RGBA color values direction in compliance with RGBA32, or by specifying HSL/HSV color values).

It may be useful to provide support for other color models (YUV, primarily). In theory, it should be possible to implement basic support for this without changing the representation of Color; instead, functions could be provided that do the conversion.

A more ideal model would provide separate color classes (or at least easy and consistent access to packed values) for various color models so that it is more easily possible to do things like write renderer-specific shaders that use those values directly; but this may be beyond the scope of a simple addition.

One particularly interesting YUV color model is OkLab. Java support has been implemented in the colorful-gdx, and can provide a basic reference point.

There are other YUV color spaces that may be useful as well.

@Chris3606 Chris3606 added the enhancement New feature or request label Jan 22, 2023
@Chris3606
Copy link
Contributor Author

One thing that also should probably be supported is color interpolation/specific gradient instances that use YUV colors as their native representation. One of the primary benefits to OkLab, for example, is it provides much smoother color interpolation; so simply converting OkLab colors to RGB and interpolating with the RGB colors won't produce much of the benefit.

It should be possible to provide some sort of gradient abstraction which allows you to perform interpolation with some arbitrary algorithm on a color space, then convert the result of that to RGB, which would preserve much of the benefit without requiring renderer-specific code to change its color representation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant