1def show_named_plotly_colours():
2 """
3 function to display to user the colours to match plotly's named
4 css colours.
5
6 Reference:
7 #https://community.plotly.com/t/plotly-colours-list/11730/3
8
9 Returns:
10 plotly dataframe with cell colour to match named colour name
11
12 """
13 s='''
14 aliceblue, antiquewhite, aqua, aquamarine, azure,
15 beige, bisque, black, blanchedalmond, blue,
16 blueviolet, brown, burlywood, cadetblue,
17 chartreuse, chocolate, coral, cornflowerblue,
18 cornsilk, crimson, cyan, darkblue, darkcyan,
19 darkgoldenrod, darkgray, darkgrey, darkgreen,
20 darkkhaki, darkmagenta, darkolivegreen, darkorange,
21 darkorchid, darkred, darksalmon, darkseagreen,
22 darkslateblue, darkslategray, darkslategrey,
23 darkturquoise, darkviolet, deeppink, deepskyblue,
24 dimgray, dimgrey, dodgerblue, firebrick,
25 floralwhite, forestgreen, fuchsia, gainsboro,
26 ghostwhite, gold, goldenrod, gray, grey, green,
27 greenyellow, honeydew, hotpink, indianred, indigo,
28 ivory, khaki, lavender, lavenderblush, lawngreen,
29 lemonchiffon, lightblue, lightcoral, lightcyan,
30 lightgoldenrodyellow, lightgray, lightgrey,
31 lightgreen, lightpink, lightsalmon, lightseagreen,
32 lightskyblue, lightslategray, lightslategrey,
33 lightsteelblue, lightyellow, lime, limegreen,
34 linen, magenta, maroon, mediumaquamarine,
35 mediumblue, mediumorchid, mediumpurple,
36 mediumseagreen, mediumslateblue, mediumspringgreen,
37 mediumturquoise, mediumvioletred, midnightblue,
38 mintcream, mistyrose, moccasin, navajowhite, navy,
39 oldlace, olive, olivedrab, orange, orangered,
40 orchid, palegoldenrod, palegreen, paleturquoise,
41 palevioletred, papayawhip, peachpuff, peru, pink,
42 plum, powderblue, purple, red, rosybrown,
43 royalblue, saddlebrown, salmon, sandybrown,
44 seagreen, seashell, sienna, silver, skyblue,
45 slateblue, slategray, slategrey, snow, springgreen,
46 steelblue, tan, teal, thistle, tomato, turquoise,
47 violet, wheat, white, whitesmoke, yellow,
48 yellowgreen
49 '''
50 li=s.split(',')
51 li=[l.replace('\n','') for l in li]
52 li=[l.replace(' ','') for l in li]
53
54 import pandas as pd
55 import plotly.graph_objects as go
56
57 df=pd.DataFrame.from_dict({'colour': li})
58 fig = go.Figure(data=[go.Table(
59 header=dict(
60 values=["Plotly Named CSS colours"],
61 line_color='black', fill_color='white',
62 align='center', font=dict(color='black', size=14)
63 ),
64 cells=dict(
65 values=[df.colour],
66 line_color=[df.colour], fill_color=[df.colour],
67 align='center', font=dict(color='black', size=11)
68 ))
69 ])
70
71 fig.show()
72
1CSS color:
2 aliceblue, antiquewhite, aqua, aquamarine, azure,
3 beige, bisque, black, blanchedalmond, blue,
4 blueviolet, brown, burlywood, cadetblue,
5 chartreuse, chocolate, coral, cornflowerblue,
6 cornsilk, crimson, cyan, darkblue, darkcyan,
7 darkgoldenrod, darkgray, darkgrey, darkgreen,
8 darkkhaki, darkmagenta, darkolivegreen, darkorange,
9 darkorchid, darkred, darksalmon, darkseagreen,
10 darkslateblue, darkslategray, darkslategrey,
11 darkturquoise, darkviolet, deeppink, deepskyblue,
12 dimgray, dimgrey, dodgerblue, firebrick,
13 floralwhite, forestgreen, fuchsia, gainsboro,
14 ghostwhite, gold, goldenrod, gray, grey, green,
15 greenyellow, honeydew, hotpink, indianred, indigo,
16 ivory, khaki, lavender, lavenderblush, lawngreen,
17 lemonchiffon, lightblue, lightcoral, lightcyan,
18 lightgoldenrodyellow, lightgray, lightgrey,
19 lightgreen, lightpink, lightsalmon, lightseagreen,
20 lightskyblue, lightslategray, lightslategrey,
21 lightsteelblue, lightyellow, lime, limegreen,
22 linen, magenta, maroon, mediumaquamarine,
23 mediumblue, mediumorchid, mediumpurple,
24 mediumseagreen, mediumslateblue, mediumspringgreen,
25 mediumturquoise, mediumvioletred, midnightblue,
26 mintcream, mistyrose, moccasin, navajowhite, navy,
27 oldlace, olive, olivedrab, orange, orangered,
28 orchid, palegoldenrod, palegreen, paleturquoise,
29 palevioletred, papayawhip, peachpuff, peru, pink,
30 plum, powderblue, purple, red, rosybrown,
31 royalblue, saddlebrown, salmon, sandybrown,
32 seagreen, seashell, sienna, silver, skyblue,
33 slateblue, slategray, slategrey, snow, springgreen,
34 steelblue, tan, teal, thistle, tomato, turquoise,
35 violet, wheat, white, whitesmoke, yellow,
36 yellowgreen
37