Document colors
What is the problem or limitation you are having?
Toga's docs mention colors in the context of Pack and Canvas, but offer no explanation of what formats are available.
Describe the solution you'd like
I think a page on Color would make a good addition to the Style category (and Pack can finally stop being lonely). It should go over:
- All the predefined colors (ideally with a swatch for each), and explain using string literals or the constants
- The various string formats that can be parsed:
- '#rgb'
- '#rgba'
- '#rrggbb'
- '#rrggbbaa'
- '#RGB'
- '#RGBA'
- '#RRGGBB'
- '#RRGGBBAA'
- ~~'rgb(0, 0, 0)'~~
- ~~'rgba(0, 0, 0, 0.0)'~~
- ~~'hsl(0, 0%, 0%)'~~
- ~~'hsla(0, 0%, 0%, 0.0)'~~
- Instances of the actual color classes, just for completeness's sake
I'm realizing that I don't even know, myself, whether (and where) transparent colors work, i.e. if you give a widget a transparent color, will it respect the alpha value and composite its text over its background. This would be a good thing to describe as well.
Describe alternatives you've considered
It could also go in Resources... but each of those is a well-defined class in Toga itself that users are likely to use directly, whereas this would be more a general coverage of "what can you supply to a parameter that expects a color".
Additional context
No response
+1. Sounds like an ideal topic guide (for how to specify colors) and/or reference guide (for the color swatches and definition of allowed formats).
As for transparent colors - On most platforms, transparency will work. Will a transparent color work as a background/foreground color on a widget?... maybe, depends on the widget and the platform. It definitely works on the background for a Box, which will be the major use case (I hope...), and we've recently added a bunch of code to implement transparent blending on the one platform that doesn't do blending out of the box (Winforms).
Probably worth waiting till after (or handling as part of) #3611.