Merge pull request #3224 from panuhorsmalahti/colors-fix

Add color functions to the colors module and tests for them
This commit is contained in:
Masahiro Wakame
2014-11-26 20:06:50 +09:00
2 changed files with 24 additions and 0 deletions
+13
View File
@@ -1,5 +1,18 @@
///<reference path="colors.d.ts" />
import colors = require("colors");
var test:string = 'test';
var arr:string[] = ['color', 'odd'.italic.zebra, 'radical'.bold.rainbow, test.underline + 'super'.green];
colors.black("abc").trim();
colors.red("abc").trim();
colors.green("abc").trim();
colors.yellow("abc").trim();
colors.blue("abc").trim();
colors.magenta("abc").trim();
colors.cyan("abc").trim();
colors.white("abc").trim();
colors.gray("abc").trim();
colors.grey("abc").trim();
+11
View File
@@ -5,6 +5,17 @@
declare module "colors" {
export function setTheme(theme:any):any;
export function black(text: string): string;
export function red(text: string): string;
export function green(text: string): string;
export function yellow(text: string): string;
export function blue(text: string): string;
export function magenta(text: string): string;
export function cyan(text: string): string;
export function white(text: string): string;
export function gray(text: string): string;
export function grey(text: string): string;
}
interface String {