Imported 'MAX_PIXELS' and replaced a hard coded pixel maximum.
This commit is contained in:
parent
f22e3a2a56
commit
143debb5f6
1 changed files with 2 additions and 2 deletions
|
|
@ -9,11 +9,11 @@ __version__ = 0.3
|
||||||
__author__ = "Jan Klopper <jan@underdark.nl>"
|
__author__ = "Jan Klopper <jan@underdark.nl>"
|
||||||
|
|
||||||
import random
|
import random
|
||||||
from vloed import PixelVloedClient, NewMessage, RGBPixel
|
from vloed import PixelVloedClient, NewMessage, RGBPixel, MAX_PIXELS
|
||||||
|
|
||||||
def RandomFill(message, width, height):
|
def RandomFill(message, width, height):
|
||||||
"""Generates a random number of pixels with a random color"""
|
"""Generates a random number of pixels with a random color"""
|
||||||
for pixel in xrange(0, random.randint(10, 140)):
|
for pixel in xrange(0, random.randint(10, MAX_PIXELS)):
|
||||||
pixel = RGBPixel(random.randint(0, width),
|
pixel = RGBPixel(random.randint(0, width),
|
||||||
random.randint(0, height),
|
random.randint(0, height),
|
||||||
random.randint(0, 255),
|
random.randint(0, 255),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue