Skip to content

Instantly share code, notes, and snippets.

@Cyken-Zeraux
Created January 5, 2017 14:00
Show Gist options
  • Save Cyken-Zeraux/93434fbd4342a69396f4e74d26c97cbe to your computer and use it in GitHub Desktop.
Save Cyken-Zeraux/93434fbd4342a69396f4e74d26c97cbe to your computer and use it in GitHub Desktop.
let MonoSColorsRAW = require("json-loader!yaml-loader!./monospace-colors2.yaml");
class MonoSColors {
private static ColorObjectByUint32Object: any;
private static ColorObjectArrayArray: Array<any>;
public ColorObjectArray: any = () => {
if(MonoSColors.ColorObjectArrayArray != null)
{
return MonoSColors.ColorObjectArrayArray;
}
let colorArray: any[] = [];
let ByUint32Colors2: any = this.ColorObjectByUint32();
var ByUint32Colors = this.ColorObjectByUint32();
for(var key in ByUint32Colors)
{
let object = {};
for(var key2 in ByUint32Colors[key])
{
object[key2] = ByUint32Colors[key][key2];
}
object['uint32'] = key;
colorArray.push(object);
}
MonoSColors.ColorObjectArrayArray = colorArray;
return colorArray;
}
public ColorObjectByUint32: any = () => {
if(MonoSColors.ColorObjectByUint32Object != null)
{
return MonoSColors.ColorObjectByUint32Object;
}
var colorObject: any = {};
for(var key in MonoSColorsRAW)
{
for(var key2 in MonoSColorsRAW[key])
{
colorObject[key2] = MonoSColorsRAW[key][key2];
}
}
MonoSColors.ColorObjectByUint32Object = colorObject;
return colorObject;
}
}
export let MonoSpaceColors = new MonoSColors();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment