rumps
rumps copied to clipboard
Change color of text in menubar
It's possible to use color icons, but is it also possible to change the text color in the menubar?
I don't think I've seen this before but it's maybe possible. Anyone know?
It's hacky, but this works (only changing the alpha channel in this example):
color = NSColor.colorWithCalibratedRed_green_blue_alpha_(1, 1, 1, 0.4)
attributes = propertyListFromPythonCollection({NSForegroundColorAttributeName: color}, conversionHelper=lambda x: x)
string = NSAttributedString.alloc().initWithString_attributes_(' ' + self.active_station, attributes)
self._nsapp.nsstatusitem.setAttributedTitle_(string)
I've used this in my RadioBar app
If you want to make a PR, this seems cool.
@jaredks a function for this would be nice, but I think this requires some good design to figure out what would be a universal way to do this. I'll leave it for now, if I need a general way I'll submit a PR.