This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Gradient.h" | |
#include <vector> | |
Gradient::GradientColor::GradientColor(float _r, float _g, float _b, float _a):r(_r), g(_g), b(_b), a(_a) {} | |
Gradient::GradientColor::GradientColor():r(), g(0), b(0), a(0) {} | |
const Gradient::GradientColor & Gradient::GradientColor::operator+=(const GradientColor &lhs){ | |
r += lhs.r; | |
g += lhs.g; | |
b += lhs.b; | |
a += lhs.a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
def lerp(s,e,t): | |
return s + (e-s)*t | |
def printStop(gradient_name, t, rgba): | |
newRGBA = [int(c*255) for c in rgba] | |
format_args = tuple([gradient_name, t] + newRGBA) | |
return "%s.addColorStop(%f, \"rgba(%d, %d, %d, %d)\");\n"%format_args; | |
def parseGimpGradient(filename): | |
file = open(filename, "r"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
import sys | |
import time | |
import string | |
import random | |
import hashlib | |
import os | |
out = "ERROR: No argument was given or the given argument was invalid." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import Image | |
import os, sys | |
if __name__ == "__main__": | |
if len(sys.argv) != 4: | |
print("Usage: %s secret pad output"%(sys.argv[0],)) | |
sys.exit(0); | |
secret = Image.open(sys.argv[1]) | |
secret.convert("RGB"); | |
secretPixels = secret.load(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "image.h" | |
uint32_t getpixel(image_t *image, unsigned int x, unsigned int y){ | |
return image->pixels[(y*image->w)+x]; | |
} | |
float lerp(float s, float e, float t){return s+(e-s)*t;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Vector(x,y){ | |
this.x = x; | |
this.y = y; | |
}; | |
Vector.prototype.iadd = function(x, y){ | |
if(typeof(x)=="number"){ | |
this.x += x; | |
this.y += y; | |
}else{ | |
this.x += x.x; |
NewerOlder