I get named colours in wx
this way:
import wx.lib.colourdb as wb
wb.getColourList()
Although "ORANGE" is in wx.lib.colourdb
, i cannot set a grid cell's color to wx.ORANGE
because it says:
AttributeError: 'module' object has no attribute 'ORANGE'
How do I use the colors defined in wx.lib.colourdb.getColourList()
?
color = wx.NamedColour("orange")
some_window.SetForegroundColour("orange")
(make sure you start your app first)
in order to load some of the colours into wx.TheColourDatabase
you will need to run
wx.lib.colourdb.updateColourDB() #adds ALOT more named colours to wx.TheColourDatabase
c1 = wx.NamedColour("light coral")
c2 = wx.NamedColour("peachpuff2")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With