Example #1
0
def VADtoRGB(V, A, D):
	from common import linTrans
	Vv = [1.0, 1.0, -1.0]
	Av = [1.0, -0.5, -1.0]
	Dv = [1.0, 1.0, 1.0]

	C = [0, 0, 0]
	C[0] = Vv[0]*V + Av[0]*A + Dv[0]*D
	C[1] = Vv[1]*V + Av[1]*A + Dv[1]*D
	C[2] = Vv[2]*V + Av[2]*A + Dv[2]*D

	maxC = max(max([abs(c) for c in C]), 1.0)
	C = [c/maxC for c in C]

	#C = [RED, GREEN, BLUE] # just get the value

	if C == [0, 0, 0]:
		#C = [0.75, 0.75, 0.75]
		if tk_BGC == "black":
			C = [1, 1, 1]
		else:
			C = [-0.75, -0.75, -0.75]

	C = [int(linTrans(c, [(-1, 0), (1, 255)])) for c in C]

	return C
Example #2
0
def VADtoRGB(V, A, D):
    from common import linTrans
    Vv = [1.0, 1.0, -1.0]
    Av = [1.0, -0.5, -1.0]
    Dv = [1.0, 1.0, 1.0]

    C = [0, 0, 0]
    C[0] = Vv[0] * V + Av[0] * A + Dv[0] * D
    C[1] = Vv[1] * V + Av[1] * A + Dv[1] * D
    C[2] = Vv[2] * V + Av[2] * A + Dv[2] * D

    maxC = max(max([abs(c) for c in C]), 1.0)
    C = [c / maxC for c in C]

    #C = [RED, GREEN, BLUE] # just get the value

    if C == [0, 0, 0]:
        #C = [0.75, 0.75, 0.75]
        if tk_BGC == "black":
            C = [1, 1, 1]
        else:
            C = [-0.75, -0.75, -0.75]

    C = [int(linTrans(c, [(-1, 0), (1, 255)])) for c in C]

    return C
Example #3
0
def ccRotateAnimation():
	from common import linTrans

	global CL, CL2, CCAngles
	

	# now place images on canvas
	#elapsed_time = time.time() - GLOB['prevUsageTime']
	
	energy = GLOB['MOOD'][1]

	for i in range(len(CL2)):
		if random() > 0.75:
			
			angle = linTrans(energy, [(-1, 5), (1, 15)]) #*(i+1)#randint(1, 4)*5
			rotateCircle(index=i, angle=angle)


	t = threading.Timer(linTrans(energy, [(-1, 1.5), (1, 0.5)]), ccRotateAnimation)
	t.daemon = True
	t.start()
Example #4
0
def ccRotateAnimation():
    from common import linTrans

    global CL, CL2, CCAngles

    # now place images on canvas
    #elapsed_time = time.time() - GLOB['prevUsageTime']

    energy = GLOB['MOOD'][1]

    for i in range(len(CL2)):
        if random() > 0.75:

            angle = linTrans(energy, [(-1, 5),
                                      (1, 15)])  #*(i+1)#randint(1, 4)*5
            rotateCircle(index=i, angle=angle)

    t = threading.Timer(linTrans(energy, [(-1, 1.5), (1, 0.5)]),
                        ccRotateAnimation)
    t.daemon = True
    t.start()