gdesk.graphics.functions module¶
- gdesk.graphics.functions.arrayToQPath(x, y, connect='all')¶
Convert an array of x,y coordinats to QPainterPath as efficiently as possible. The connect argument may be ‘all’, indicating that each point should be connected to the next; ‘pairs’, indicating that each pair of points should be connected, or an array of int32 values (0 or 1) indicating connections.
- gdesk.graphics.functions.intColor(index, hues=9, values=1, maxValue=255, minValue=150, maxHue=360, minHue=0, sat=255, alpha=255, **kargs)¶
Creates a QColor from a single index. Useful for stepping through a predefined list of colors.
The argument index determines which color from the set will be returned. All other arguments determine what the set of predefined colors will be
Colors are chosen by cycling across hues while varying the value (brightness). By default, this selects from a list of 9 hues.
- gdesk.graphics.functions.mkBrush(*args, **kwds)¶
- Convenience function for constructing Brush.This function always constructs a solid brush and accepts the same arguments as
mkColor()
Calling mkBrush(None) returns an invisible brush.
- gdesk.graphics.functions.mkColor(*args)¶
Convenience function for constructing QColor from a variety of argument types. Accepted arguments are:
‘c’
one of: r, g, b, c, m, y, k, w
R, G, B, [A]
integers 0-255
(R, G, B, [A])
tuple of integers 0-255
float
greyscale, 0.0-1.0
int
see
intColor()
(int, hues)
see
intColor()
“RGB”
hexadecimal strings; may begin with ‘#’
“RGBA”
“RRGGBB”
“RRGGBBAA”
QColor
QColor instance; makes a copy.