Commit 6f66077
authored
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.java1 parent 0da5a7f commit 6f66077
1 file changed
Lines changed: 74 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
164 | 192 | | |
165 | 193 | | |
166 | 194 | | |
| |||
203 | 231 | | |
204 | 232 | | |
205 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
206 | 280 | | |
207 | 281 | | |
208 | 282 | | |
| |||
0 commit comments