예제 #1
0
    def finalFromRGB(self, rgb):
        b = 0.5
        if self.cm.modifiers[0]:
            b += 0.25
        if self.cm.modifiers[1]:
            b += 0.25

        return color.RGB(rgb[0] * b, rgb[1] * b, rgb[2] * b)
예제 #2
0
    def update_at_progress(self, progress, new_loop, loop_instance):
        mode = self.step_mode(3)

        if mode == 0:
            # Color striped from top to bottom by slices
            v_range = tween.easeInQuad(0.1, 0.98,
                                       (self.cm.intensified + 1.0) / 2.0)
            #v_range = 0.1 + ((self.cm.intensified + 1.0)/2.0 * 0.89)  # how much of the hue cycle to spread across top to bottom

            per_slice = v_range / len(ice_geom.SLICES)

            for idx, sl in enumerate(ice_geom.SLICES):
                hue = progress - (idx * per_slice) + self.offsets[0]
                if hue > 1.0:
                    hue -= 1.0
                if hue < 0.0:
                    hue += 1.0
                hsv = (hue, 1.0, 1.0)

                rgbTuple = color.hsvRYB_to_rgb(hsv)
                rgb = color.RGB(*rgbTuple)

                self.ss.party.set_cells(sl, rgb)

        elif mode == 1:
            # Each icicle gets a unique color based on it's offset
            for idx, icicle in enumerate(ice_geom.ICICLES):
                hue = progress + self.offsets[idx]
                if hue > 1.0:
                    hue -= 1.0
                hsv = (hue, 1.0, 1.0)

                rgbTuple = color.hsvRYB_to_rgb(hsv)
                rgb = color.RGB(*rgbTuple)

                self.ss.party.set_cells(icicle, rgb)

        else:
            # Everything the same color
            hsv = (progress + self.offsets[0], 1.0, 1.0)

            rgbTuple = color.hsvRYB_to_rgb(hsv)
            rgb = color.RGB(*rgbTuple)
            self.ss.party.set_all_cells(rgb)
예제 #3
0
    def tween_rgb_at(self, progress, output):
        """
        Go through all cells that we have in next and morph them
        towards their next color at the given progress value
        """
        for cell_id in self.next.keys():
            next_color = self.next[cell_id]

            if cell_id in self.last:
                last_color = self.last[cell_id]
            else:
                last_color = color.BLACK

            r = tween.linear(last_color.r, next_color.r, progress)
            g = tween.linear(last_color.g, next_color.g, progress)
            b = tween.linear(last_color.b, next_color.b, progress)
            cell_color = color.RGB(r, g, b)
            output(cell_id, cell_color)
예제 #4
0
파일: palette.py 프로젝트: oppenhaus/lights
def RgbColor(r, g, b):
    return color.RGB(r, g, b)
예제 #5
0
	def __init__(self, apk, package):
		self.apk=apk
		self.cpu=cpu.CPU()
		self.syscall=syscall.SYSCALL(package)
		self.color=color.RGB(package)
		self.test=test.Test(apk)
예제 #6
0
 def finalFromRGB(self, rgb):
     return color.RGB(rgb[0], rgb[1], rgb[2])