MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / convertColorNameToHex

Function convertColorNameToHex

lib/colorUtils.js:4–155  ·  view source on GitHub ↗

* Convert a css color name to the hex equivalent

(color)

Source from the content-addressed store, hash-verified

2 * Convert a css color name to the hex equivalent
3 */
4function convertColorNameToHex(color) {
5 const colors = {
6 aliceblue: '#f0f8ff',
7 antiquewhite: '#faebd7',
8 aqua: '#00ffff',
9 aquamarine: '#7fffd4',
10 azure: '#f0ffff',
11 beige: '#f5f5dc',
12 bisque: '#ffe4c4',
13 black: '#000000',
14 blanchedalmond: '#ffebcd',
15 blue: '#0000ff',
16 blueviolet: '#8a2be2',
17 brown: '#a52a2a',
18 burlywood: '#deb887',
19 cadetblue: '#5f9ea0',
20 chartreuse: '#7fff00',
21 chocolate: '#d2691e',
22 coral: '#ff7f50',
23 cornflowerblue: '#6495ed',
24 cornsilk: '#fff8dc',
25 crimson: '#dc143c',
26 cyan: '#00ffff',
27 darkblue: '#00008b',
28 darkcyan: '#008b8b',
29 darkgoldenrod: '#b8860b',
30 darkgray: '#a9a9a9',
31 darkgreen: '#006400',
32 darkkhaki: '#bdb76b',
33 darkmagenta: '#8b008b',
34 darkolivegreen: '#556b2f',
35 darkorange: '#ff8c00',
36 darkorchid: '#9932cc',
37 darkred: '#8b0000',
38 darksalmon: '#e9967a',
39 darkseagreen: '#8fbc8f',
40 darkslateblue: '#483d8b',
41 darkslategray: '#2f4f4f',
42 darkturquoise: '#00ced1',
43 darkviolet: '#9400d3',
44 deeppink: '#ff1493',
45 deepskyblue: '#00bfff',
46 dimgray: '#696969',
47 dodgerblue: '#1e90ff',
48 firebrick: '#b22222',
49 floralwhite: '#fffaf0',
50 forestgreen: '#228b22',
51 fuchsia: '#ff00ff',
52 gainsboro: '#dcdcdc',
53 ghostwhite: '#f8f8ff',
54 gold: '#ffd700',
55 goldenrod: '#daa520',
56 gray: '#808080',
57 green: '#008000',
58 greenyellow: '#adff2f',
59 honeydew: '#f0fff0',
60 hotpink: '#ff69b4',
61 indianred: '#cd5c5c',

Callers 1

convertColorToRGBAFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected