feat(JOML): migrate Color#8
Conversation
skaldarnar
left a comment
There was a problem hiding this comment.
I was confused at first, but now the changes do make sense 👍
One addition (for a follow-up PR to keep the feature separate) would be to support color created and modification in other "formats" such as HSB. This would be helpful to do gradients easily in UI elements.
| public class Color { | ||
| public class Color implements Colorc{ | ||
|
|
||
| @Deprecated |
There was a problem hiding this comment.
Deprecating these sounds weird to me - isn't Color the class we want to use?
There was a problem hiding this comment.
See comment below, confusion about Colorc was resolved. Just to ensure I get this right - in case I want to have a half-transparent green somewhere I'd need to do something like this, right:
Color transparentGreen = new Color(Color.green).setAlpha(0.5f);Would it make sense to offer both a read-only value for the base colors and a static method that returns a new modifiable value? So for each base we would have a pair of
public static final Colorc WHITE = new Color(0xFFFFFFFF);
public static Color white() {
return new Color(WHITE);
}The example above could then become
Color transparentGreen = Color.green().setAlpha(0.5f);| @Deprecated | ||
| public static final Color MAGENTA = new Color(0xFF00FFFF); | ||
|
|
||
| public static final Colorc black = new Color(0x000000FF); |
There was a problem hiding this comment.
Why do we want to expose only Colorc instead of Color? Should this rather be a helper class for working with JOML's color?
There was a problem hiding this comment.
Ah, now I got that Colorc is our own doing 🤓 (similar to what JOML does) 💡
|
Note: This PR addresses the current state of NUI (gestalt v5). PR #4 needs to be updated in case we merge this first. |
This is a rework of how colors work in nui. This is more consistent with JOML. I think this configuration should be easier to use. toVector3f, toVector3i and toVector4f are not used in any of the modules under omega or the engine. If its not used then It would probably be ok to just remove the methods entirely. I also update some of the documentation at the same time. There are some cases I'm probably not considering.
ref: MovingBlocks/Terasology#4118