You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add set methods and constructors to ColorRGBA that take in a Vector param (#1757)
* Add additional set methods to ColorRGBA
I've noticed that ColorRGBA has a very useful .toVector4f() method (and also toVector3() method), which are great for instances where you need to do math with a Color value returned from an ImageRaster, but there is no equally convenient method to convert that Vector back into a color, so I thought these 2 methods could be useful (specifically for Vector4fs, but I added one for Vector3f too since there was already a toVector3f() method)
I initially thought of adding a new toColorRGBA() method to the Vector classes, but it seemed more appropriate to put this functionality into the ColorRGBA class here with set methods the way I did.
Any thoughts on this addition?
* Update ColorRGBA.java
* add vector constructor
I added constructors that take in a Vector3f and Vector4f
In the case of a vector3 constructor I also just set the alpha value to 1.0 since it's more likely the user wants a visible opaque color, but can change this if there's a more optimal solution.
* Update ColorRGBA.java
* Update ColorRGBA.java
grammar correction in javadoc
* Update ColorRGBA.java
0 commit comments