Skip to content

Instantly share code, notes, and snippets.

@keisans
keisans / gist:5526435
Created May 6, 2013 17:04
Color system draft 1
Color = function(color) {
this.hex = this.parseHex(color);
this.rgb = this.hex2rgb();
this.hsl = this.rgb2hsl();
}
Color.prototype = (function(){
var _public = {};
_public.parseHex = function(hex){
@keisans
keisans / bitwiseFlags.js
Last active September 11, 2023 12:41
A javascript flags system based on bitwise function. This function allows for the representation of a flag state in a single base 10 number. This library also includes the ability to parse information about the flags, with functions to check if any (`hasAny`) or all (`hasAllOf`), of a group have been set, as well as their inverses (`notAny` and …
/**
* @class Flags
* @constructor
* @param {Array} newFlags Optional array of flag keys to define when the flags module is instantiated
*/
Flags = function( newFlags ){
this.flags = 0;
this.flagHash = {};
this.keys = 0;
if(newFlags){
@keisans
keisans / dabblet.css
Created June 7, 2012 12:45
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;