Skip to content

Instantly share code, notes, and snippets.

View expectocode's full-sized avatar

Tanuj expectocode

View GitHub Profile
@udf
udf / ass.py
Created April 13, 2018 13:47
Generates fancy colours by abusing the order(lessness) of a set; it's called ass because i didn't expect it to work so well (or at all)
from PIL import Image
import random
def thing(val):
val += (-4, -3, -2, -1, 1, 2, 3, 4)[random.getrandbits(3)]
if val < 0: return 0
if val > 255: return 255
return val