Skip to content

Instantly share code, notes, and snippets.

View grampabacon's full-sized avatar
💭
Typing Furiously

Adam Goodman grampabacon

💭
Typing Furiously
View GitHub Profile
@grampabacon
grampabacon / background_colour_gen.py
Last active September 28, 2021 14:36
paper-cats-background-colour-gen
import random
# Generate a random (but bounded) RGB value, run it through the HSL algorithm
# Run recursively until we are happy that the colour looks good.
def get_background_colour():
r = random.randint(100, 255)
g = random.randint(100, 255)
b = random.randint(100, 255)
light = lightness(r, g, b)
import pathlib
from PIL import Image
# Layer the transparent cat onto a solid pink background image and save.
def create_cat(id):
image = Image.open("Paper_Cat_Transparent.png")
path = "cats/"
package com.grampabacon.shors;
import static java.lang.String.format;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import org.mathIT.numbers.Numbers;
import org.mathIT.quantum.Circuit;