Example #1
0
 def __draw_point(self, i: int) -> None:
     """Draw point function."""
     k = i
     for j in range(i):
         if j in self.mechanism['same']:
             k += 1
     x, y = self.pos[i]
     color = color_rgb('green')
     fixed = False
     if i in self.target_path:
         color = color_rgb('dark-orange')
     elif k in self.mechanism['placement']:
         color = color_rgb('blue')
         fixed = True
     self.draw_point(i, x, y, fixed, color)
Example #2
0
def color_qt(color: _Color) -> QColor:
    """Get color and translate to QColor."""
    if color is None:
        color = "green"
    if isinstance(color, str):
        return QColor(*color_rgb(color))
    else:
        return QColor(*color)
Example #3
0
def color_qt(name: str) -> QColor:
    """Get color and translate to QColor."""
    return QColor(*color_rgb(name))