krakjoe / ui

Cross platform UI development in PHP
Other
518 stars 39 forks source link

[request] UI\Draw\Color::getRgba(): int, ::setRgba(int $rgba), __toString() #48

Closed dmvdbrugge closed 1 year ago

dmvdbrugge commented 6 years ago

The constructor of UI\Draw\Color accepts int $rgba (usually written in hex format).

While I can get/set the separate channels and even directly access the properties (as they are public), I would also like to be able to get that int-value via a getter, and to be able to change it through a setter.

And if you're feeling really fancy you could even implement a __toString resulting in the rgba hex color code.

(I think I will implement all these (in userland) in Dynamic Components, but native would be even better.)

dmvdbrugge commented 1 year ago

Closing to clean up my stuff and this repo is dead anyway.