예제 #1
0
	def draw(self, c, r):
		c.backcolor = rgb(0.94, 0.94, 0.94)
		c.erase_rect(r)
		main_image_pos = (int(self.width/2-80), int(self.height/2-90))
		src_rect = self.image.bounds
		#say("Image bounds =", src_rect)
		dst_rect = offset_rect(src_rect, main_image_pos)
		#say("Drawing", src_rect, "in", dst_rect)
		self.image.draw(c, src_rect, dst_rect)
예제 #2
0
    def _get_color(self, color_spec):
        key = repr(color_spec)
        if key in _color_map:
            return _color_map[key]

        c = map(lambda x: x / 255, map(float, color_spec))

        _color_map[key] = r = rgb(*c)

        return r
예제 #3
0
    def gen_render_color(self, color_spec):
        c = map(lambda x: x / 255, map(float, color_spec))

        return rgb(*c)
예제 #4
0
파일: StdColors.py 프로젝트: mnabeelp/PyGUI
#
#   Python GUI - Standard Colors - Generic
#

from GUI.Colors import rgb, selection_forecolor, selection_backcolor

black = rgb(0, 0, 0)
dark_grey = rgb(0.25, 0.25, 0.25)
grey = rgb(0.5, 0.5, 0.5)
light_grey = rgb(0.75, 0.75, 0.75)
white = rgb(1, 1, 1)
red = rgb(1, 0, 0)
green = rgb(0, 1, 0)
blue = rgb(0, 0, 1)
yellow = rgb(1, 1, 0)
cyan = rgb(0, 1, 1)
magenta = rgb(1, 0, 1)
clear = rgb(0, 0, 0, 0)