addColorKeywordHex static method

void addColorKeywordHex(
  1. String colorname,
  2. dynamic hex
)

Add Hex color (string or int) to the colorKeywords[] map that is used for dynamic lookup of colors by name. Colors added thid way can be used directly follwing the Chalk color/csscolor/x11 methods. ie. Chalk.addColorKeywordHex('myfavorite', 0x6495ED ); // using hex int chalk.color.myfavorite('This is my favorite color'); Chalk.addColorKeywordHex('my2ndFavorite', '#6A5ACD' ); // or using string chalk.color.my2ndfavorite('This is my 2nd favorite color');

Implementation

static void addColorKeywordHex(String colorname, dynamic hex) {
  ColorUtils.addColorKeywordHex(colorname, hex);
}