MCPcopy
hub / github.com/webpack/webpack / createColors

Function createColors

lib/cli.js:936–978  ·  view source on GitHub ↗
({ useColor = isColorSupported() } = {})

Source from the content-addressed store, hash-verified

934 * @returns {Colors} colors
935 */
936const createColors = ({ useColor = isColorSupported() } = {}) => ({
937 reset: useColor ? init(0, 0) : String,
938 bold: useColor ? init(1, 22, "\u001B[22m\u001B[1m") : String,
939 dim: useColor ? init(2, 22, "\u001B[22m\u001B[2m") : String,
940 italic: useColor ? init(3, 23) : String,
941 underline: useColor ? init(4, 24) : String,
942 inverse: useColor ? init(7, 27) : String,
943 hidden: useColor ? init(8, 28) : String,
944 strikethrough: useColor ? init(9, 29) : String,
945 black: useColor ? init(30, 39) : String,
946 red: useColor ? init(31, 39) : String,
947 green: useColor ? init(32, 39) : String,
948 yellow: useColor ? init(33, 39) : String,
949 blue: useColor ? init(34, 39) : String,
950 magenta: useColor ? init(35, 39) : String,
951 cyan: useColor ? init(36, 39) : String,
952 white: useColor ? init(37, 39) : String,
953 gray: useColor ? init(90, 39) : String,
954 bgBlack: useColor ? init(40, 49) : String,
955 bgRed: useColor ? init(41, 49) : String,
956 bgGreen: useColor ? init(42, 49) : String,
957 bgYellow: useColor ? init(43, 49) : String,
958 bgBlue: useColor ? init(44, 49) : String,
959 bgMagenta: useColor ? init(45, 49) : String,
960 bgCyan: useColor ? init(46, 49) : String,
961 bgWhite: useColor ? init(47, 49) : String,
962 blackBright: useColor ? init(90, 39) : String,
963 redBright: useColor ? init(91, 39) : String,
964 greenBright: useColor ? init(92, 39) : String,
965 yellowBright: useColor ? init(93, 39) : String,
966 blueBright: useColor ? init(94, 39) : String,
967 magentaBright: useColor ? init(95, 39) : String,
968 cyanBright: useColor ? init(96, 39) : String,
969 whiteBright: useColor ? init(97, 39) : String,
970 bgBlackBright: useColor ? init(100, 49) : String,
971 bgRedBright: useColor ? init(101, 49) : String,
972 bgGreenBright: useColor ? init(102, 49) : String,
973 bgYellowBright: useColor ? init(103, 49) : String,
974 bgBlueBright: useColor ? init(104, 49) : String,
975 bgMagentaBright: useColor ? init(105, 49) : String,
976 bgCyanBright: useColor ? init(106, 49) : String,
977 bgWhiteBright: useColor ? init(107, 49) : String
978});
979
980module.exports.createColors = createColors;
981module.exports.getArguments = getArguments;

Callers 1

Cli.basictest.jsFile · 0.85

Calls 2

isColorSupportedFunction · 0.85
initFunction · 0.70

Tested by

no test coverage detected