Go to the first, previous, next, last section, table of contents.


color Extension Module

color provides a screen mixin for color handling:

Screen Mixin: Color

Color handles color allocation. It maintains a cache of allocated colors to reduce PLWM's colormap footprint on displays with a low bit depth.

Method: Color get_color ( color, default = None )

Returns the pixel value corresponding to color. color can be a string or tuple of (R, G, B) integers. If the color can't be allocated and default is provided, get_color tries to return that color instead. If that fails too, it raises a ColorError exception.

Method: Color get_color_res ( res_name, res_class, default = None )

Return the pixel value for the color defined in the X resource identified by res_name res_class. WindowManager.rdb_get is used to lookup the resource, so the first components of the name and class should be omitted and they should start with `.'.

If default is provided, that name will be used if no matching X resource is found. If omitted, or if the color can't be allocated, ColorError is raised.


Go to the first, previous, next, last section, table of contents.