[Share]CSS Color Selector/Picker Wrench utility
Phuket2 last edited by
A very simple utility to select/filter from the 148 CSS color names. Then you can copy the CSS name to the clipboard for pasting into your code. Done as a popover, as it makes sense for what it is. I like using CSS color names. Just makes things easy to read for me rather than seeing a bunch of rgb values. Also in combination with ui.parse_color you can an alpha to achieve a RGBA.
Anyway, here is a gist, I have done as a gist because I want to do more to it . I say in the comments.
But I just wanted to do something. I never finish things because I want it better and better. In this case I have just done what I could do comfortably. I mean the design. I know it's not great, but it could also be worse.
Again, it's super basic, but still useful if you use CSS colors.
uj_jonas last edited by
Awesome :D definitely going to be using this. I just made a few changes to it, so that it writes it in the editor directly instead of copying it to the clipboard.
Also, I just have to know, what keyboard are you using?
Phuket2 last edited by
@uj_jonas , great! the keyboard is just std. but I am on a iPad Pro 12.7 inch.
It's not important, but I changed the main a little to deal with style presentations other than popover and sheet. I forgot about it because you normally you would never want to see this full screen on a ipad.
if __name__ == '__main__': w = 320 h = ui.get_screen_size()*.6 f = (0, 0, w, h) style = 'popover' title_color = 'white' title_bar_color = 'coral' animated = False # jst added this... if not style is 'sheet' and not style is 'popover': w,h = ui.get_screen_size() f = (0, 0, w, h) mc = MyClass(name='CSS Color Lookup', frame=f, bg_color='white') mc.present(style=style, animated=animated, title_color=title_color, title_bar_color=title_bar_color)
Phuket2 last edited by Phuket2
Hmmm, actually, I made a few other small mistakes for it to be all view/orientation friendly. The ui.TextField in search panel and ui.Label in footerpane; did not have their flex attrs set.
If intrested, I hope this gist Fixes it. a lot of combinations to test
It's only half import, because can easily change MyDataClass, to point to some other simple data items or with a little effort use it for other things.