code: function prepareColors(colors) {
      Object.keys(colors).forEach(function (color) {
          var code = colors[color],
              replaced = replaceColors(code, colors);
  
          if (replaced !== code) {
              colors[color] = replaced;
          }
      });
  }
docs: prepare color table (resolve logical color names)