def paint_foreground_cb(self, cr, wd, ht): """Fg marker painting, for `ColorAdjusterWidget` impls. """ col = HSVColor(color=self.get_managed_color()) col.s = 1.0 radius = self.get_radius(wd, ht, self.BORDER_WIDTH) cx = int(wd // 2) cy = int(ht // 2) cr.arc(cx, cy, radius + 0.5, 0, 2 * math.pi) cr.clip() x, y = self.get_pos_for_color(col) col.s = 0.70 ex, ey = self.get_pos_for_color(col) cr.set_line_width(5) cr.move_to(x, y) cr.line_to(ex, ey) cr.set_source_rgb(0, 0, 0) cr.stroke_preserve() cr.set_source_rgb(1, 1, 1) cr.set_line_width(3.5) cr.stroke_preserve() cr.set_source_rgb(*col.get_rgb()) cr.set_line_width(0.25) cr.stroke()
def paint_foreground_cb(self, cr, wd, ht): """Fg marker painting, for `ColorAdjusterWidget` impls. """ col = HSVColor(color=self.get_managed_color()) col.s = 1.0 radius = self.get_radius(wd, ht, self.BORDER_WIDTH) cx = int(wd // 2) cy = int(ht // 2) cr.arc(cx, cy, radius+0.5, 0, 2*math.pi) cr.clip() x, y = self.get_pos_for_color(col) col.s = 0.70 ex, ey = self.get_pos_for_color(col) cr.set_line_width(5) cr.move_to(x, y) cr.line_to(ex, ey) cr.set_source_rgb(0, 0, 0) cr.stroke_preserve() cr.set_source_rgb(1, 1, 1) cr.set_line_width(3.5) cr.stroke_preserve() cr.set_source_rgb(*col.get_rgb()) cr.set_line_width(0.25) cr.stroke()
def color_at_normalized_polar_pos(self, r, theta): col = HSVColor(color=self.get_managed_color()) col.h = theta col.s = r return col
def get_color_for_bar_amount(self, amt): col = HSVColor(color=self.get_managed_color()) col.s = amt return col