-
Notifications
You must be signed in to change notification settings - Fork 0
/
randomColor.py
executable file
·29 lines (26 loc) · 1.06 KB
/
randomColor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import random
from color import color
class RandomColor():
def __init__(self, screen_array):
self.screen_array = screen_array
def randomColor(self):
return color(random.randint(0, 2), random.randint(0, 2), random.randint(0, 2))
def randomColorFill(self, x, y, x2, y2,types='two_ang'):
if types == 'two_ang':
for i in range(x2-x):
for j in range(y2-y):
self.screen_array[i+x][j+y] = self.randomColor()
if types == 'one_ang':
for i in range(x2):
for j in range(y2):
self.screen_array[i+x][j+y] = self.randomColor()
def randomOneColorFill(self, x, y, x2, y2,types='two_ang'):
random_color = self.randomColor()
if types == 'two_ang':
for i in range(x2-x):
for j in range(y2-y):
self.screen_array[i+x][j+y] = random_color
if types == 'one_ang':
for i in range(x2):
for j in range(y2):
self.screen_array[i+x][j+y] = random_color