Open Linklancien opened 1 month ago
After reading the code of gx, a thinks it isn't a bug but maybe it nead some comment or else about it in the doc
We can special case the .a == 255 case, to not modify the alpha, so that the tests for the defined colors (that are fully visible) will continue to work, while the -
can be closer to the reverse operation for the +
operation.
I do not see the use case for the current behavior 🤔 .
Describe the bug
gx - operator overloading not working for Color
Reproduction Steps
import gx print(gx.rgba(128, 128, 128, 255) - gx.rgba(0, 0, 0, 155))
Expected Behavior
gx - operator have to return 128, 128, 128, 100
Current Behavior
return 128, 128, 128, 255
Possible Solution
mut na := int(a.a) - b.a if na < 0 { na = 0 }
Additional Information/Context
No response
V version
V 0.4.6 7a36b44
Environment details (OS name and version, etc.)
windows, Microsoft Windows 10 Famille v19045 64 bits