1234567891011121314151617181920212223242526 |
- #!/usr/bin/python3
- from math import sin
- from random import randint
- boundX = 800
- boundY = 1000
- def drawPoint(x, y, colorR, colorG, colorB):
- hexR = hex(colorR)[2:4] if len(hex(colorR)) > 3 else hex(colorR)[2:3] + "0"
- hexG = hex(colorG)[2:4] if len(hex(colorG)) > 3 else hex(colorG)[2:3] + "0"
- hexB = hex(colorB)[2:4] if len(hex(colorB)) > 3 else hex(colorB)[2:3] + "0"
- print("px "+str(x)+" "+str(y)+" "+hexR+hexG+hexB)
- while True:
- randShiftYFactor = randint(100, boundY)
- shiftY = boundY - randShiftYFactor
- colorR = randint(0, 255)
- colorG = randint(0, 255)
- colorB = randint(0, 255)
- shift = randint(0, 5)
- for x in range(0, boundX):
- for scale in range(0, randint(0, 50)):
- drawPoint(x , int(sin(x+shift)*scale)+shiftY, colorR, colorG, colorB)
|