[{"data":1,"prerenderedAt":958},["ShallowReactive",2],{"lib:\u002Fplot\u002Ftheming":3,"lib-nav:en:\u002Fplot":927},{"id":4,"title":5,"body":6,"description":918,"extension":919,"group":920,"meta":921,"navigation":336,"order":314,"path":923,"seo":924,"stem":925,"__hash__":926},"libs\u002Fplot\u002Ftheming.md","Theming and colours",{"type":7,"value":8,"toc":909},"minimark",[9,13,22,27,254,261,375,381,389,392,453,503,507,510,744,747,751,769,802,808,812,829,833,848,890,905],[10,11,5],"h1",{"id":12},"theming-and-colours",[14,15,16,17,21],"p",{},"A plot takes its colours from CSS custom properties on the page, so a site's light and dark themes apply as they are. Where the page defines none, CSS system colours stand in, which follow the page's ",[18,19,20],"code",{},"color-scheme",". Out of the box, a plot is black on white in a light page and light on dark in a dark one.",[23,24,26],"h2",{"id":25},"custom-properties","Custom properties",[28,29,30,46],"table",{},[31,32,33],"thead",{},[34,35,36,40,43],"tr",{},[37,38,39],"th",{},"Used for",[37,41,42],{},"Custom property",[37,44,45],{},"Fallback",[47,48,49,69,84,99,114,129,144,159,174,189,204,220,236],"tbody",{},[34,50,51,55,64],{},[52,53,54],"td",{},"Members, supports, text",[52,56,57,60,61],{},[18,58,59],{},"--figure-ink",", then ",[18,62,63],{},"--ink",[52,65,66],{},[18,67,68],{},"CanvasText",[34,70,71,74,79],{},[52,72,73],{},"Background, label halos",[52,75,76],{},[18,77,78],{},"--paper",[52,80,81],{},[18,82,83],{},"Canvas",[34,85,86,89,94],{},[52,87,88],{},"Dimension lines, axes",[52,90,91],{},[18,92,93],{},"--muted",[52,95,96],{},[18,97,98],{},"GrayText",[34,100,101,104,109],{},[52,102,103],{},"Nodes, the draggable load",[52,105,106],{},[18,107,108],{},"--brand",[52,110,111],{},[18,112,113],{},"#4f46e5",[34,115,116,119,124],{},[52,117,118],{},"Normal force",[52,120,121],{},[18,122,123],{},"--color-normal",[52,125,126],{},[18,127,128],{},"#2222ff",[34,130,131,134,139],{},[52,132,133],{},"Shear force",[52,135,136],{},[18,137,138],{},"--color-shear",[52,140,141],{},[18,142,143],{},"#00af00",[34,145,146,149,154],{},[52,147,148],{},"Bending moment",[52,150,151],{},[18,152,153],{},"--color-moment",[52,155,156],{},[18,157,158],{},"#ff2222",[34,160,161,164,170],{},[52,162,163],{},"Deformed shape",[52,165,166,60,168],{},[18,167,59],{},[18,169,63],{},[52,171,172],{},[18,173,68],{},[34,175,176,179,184],{},[52,177,178],{},"Loads",[52,180,181],{},[18,182,183],{},"--color-load",[52,185,186],{},[18,187,188],{},"#ff8700",[34,190,191,194,199],{},[52,192,193],{},"Reactions",[52,195,196],{},[18,197,198],{},"--color-reaction",[52,200,201],{},[18,202,203],{},"#a020f0",[34,205,206,209,216],{},[52,207,208],{},"Truss bars in tension",[52,210,211,60,214],{},[18,212,213],{},"--color-tension",[18,215,153],{},[52,217,218],{},[18,219,158],{},[34,221,222,225,232],{},[52,223,224],{},"Truss bars in compression",[52,226,227,60,230],{},[18,228,229],{},"--color-compression",[18,231,123],{},[52,233,234],{},[18,235,128],{},[34,237,238,241,249],{},[52,239,240],{},"Font",[52,242,243,60,246],{},[18,244,245],{},"--ebp-font",[18,247,248],{},"--font-sans",[52,250,251],{},[18,252,253],{},"inherit",[14,255,256,257,260],{},"Set the properties anywhere above the plot, on ",[18,258,259],{},":root"," for a whole site:",[262,263,268],"pre",{"className":264,"code":265,"language":266,"meta":267,"style":267},"language-css shiki shiki-themes github-light github-dark",":root {\n  --ink: #1b1b3a;\n  --paper: #ffffff;\n  --color-moment: #d7263d;\n}\n\n.dark {\n  --ink: #eeeeff;\n  --paper: #0b0d1f;\n}\n","css","",[18,269,270,282,299,312,325,331,338,346,358,370],{"__ignoreMap":267},[271,272,275,278],"span",{"class":273,"line":274},"line",1,[271,276,259],{"class":277},"sScJk",[271,279,281],{"class":280},"sVt8B"," {\n",[271,283,285,289,292,296],{"class":273,"line":284},2,[271,286,288],{"class":287},"s4XuR","  --ink",[271,290,291],{"class":280},": ",[271,293,295],{"class":294},"sj4cs","#1b1b3a",[271,297,298],{"class":280},";\n",[271,300,302,305,307,310],{"class":273,"line":301},3,[271,303,304],{"class":287},"  --paper",[271,306,291],{"class":280},[271,308,309],{"class":294},"#ffffff",[271,311,298],{"class":280},[271,313,315,318,320,323],{"class":273,"line":314},4,[271,316,317],{"class":287},"  --color-moment",[271,319,291],{"class":280},[271,321,322],{"class":294},"#d7263d",[271,324,298],{"class":280},[271,326,328],{"class":273,"line":327},5,[271,329,330],{"class":280},"}\n",[271,332,334],{"class":273,"line":333},6,[271,335,337],{"emptyLinePlaceholder":336},true,"\n",[271,339,341,344],{"class":273,"line":340},7,[271,342,343],{"class":277},".dark",[271,345,281],{"class":280},[271,347,349,351,353,356],{"class":273,"line":348},8,[271,350,288],{"class":287},[271,352,291],{"class":280},[271,354,355],{"class":294},"#eeeeff",[271,357,298],{"class":280},[271,359,361,363,365,368],{"class":273,"line":360},9,[271,362,304],{"class":287},[271,364,291],{"class":280},[271,366,367],{"class":294},"#0b0d1f",[271,369,298],{"class":280},[271,371,373],{"class":273,"line":372},10,[271,374,330],{"class":280},[14,376,377,378,380],{},"Labels get a halo in the ",[18,379,78],{}," colour so they stay legible over hatching: match it to the background the plot sits on.",[23,382,384,385,388],{"id":383},"the-colors-prop","The ",[18,386,387],{},"colors"," prop",[14,390,391],{},"To colour one plot, pass any of the tones by name:",[262,393,397],{"className":394,"code":395,"language":396,"meta":267,"style":267},"language-vue shiki shiki-themes github-light github-dark","\u003CStructurePlot :solver=\"solver\" :colors=\"{ moment: '#c00', paper: 'transparent' }\" \u002F>\n","vue",[18,398,399],{"__ignoreMap":267},[271,400,401,404,408,411,414,417,421,423,425,427,429,431,433,436,439,442,445,448,450],{"class":273,"line":274},[271,402,403],{"class":280},"\u003C",[271,405,407],{"class":406},"s9eBZ","StructurePlot",[271,409,410],{"class":280}," :",[271,412,413],{"class":277},"solver",[271,415,416],{"class":280},"=",[271,418,420],{"class":419},"sZZnC","\"",[271,422,413],{"class":280},[271,424,420],{"class":419},[271,426,410],{"class":280},[271,428,387],{"class":277},[271,430,416],{"class":280},[271,432,420],{"class":419},[271,434,435],{"class":280},"{ moment: ",[271,437,438],{"class":419},"'#c00'",[271,440,441],{"class":280},", paper: ",[271,443,444],{"class":419},"'transparent'",[271,446,447],{"class":280}," }",[271,449,420],{"class":419},[271,451,452],{"class":280}," \u002F>\n",[14,454,455,456,459,460,459,463,459,466,459,469,459,472,459,475,459,478,459,481,459,484,459,487,490,491,494,495,498,499,502],{},"The tones are ",[18,457,458],{},"ink",", ",[18,461,462],{},"paper",[18,464,465],{},"muted",[18,467,468],{},"brand",[18,470,471],{},"normal",[18,473,474],{},"shear",[18,476,477],{},"moment",[18,479,480],{},"deformed",[18,482,483],{},"load",[18,485,486],{},"reaction",[18,488,489],{},"tension"," and ",[18,492,493],{},"compression",". Any CSS colour works, a ",[18,496,497],{},"var(…)"," included. ",[18,500,501],{},"DEFAULT_COLORS"," holds the default value of each.",[23,504,506],{"id":505},"black-and-white","Black and white",[14,508,509],{},"For a photocopied test or a print in black and white, set every coloured tone to ink:",[262,511,513],{"className":394,"code":512,"language":396,"meta":267,"style":267},"\u003Cscript setup lang=\"ts\">\nimport type { PlotColors } from '@edubeam\u002Fplot'\n\nconst print: Partial\u003CPlotColors> = {\n  ink: '#000', paper: '#fff', muted: '#555', brand: '#000',\n  normal: '#000', shear: '#000', moment: '#000', deformed: '#000',\n  load: '#000', reaction: '#000', tension: '#000', compression: '#000',\n}\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003CStructurePlot :solver=\"solver\" :colors=\"print\" :animate=\"false\" \u002F>\n\u003C\u002Ftemplate>\n",[18,514,515,536,554,558,584,611,635,659,663,672,676,686,735],{"__ignoreMap":267},[271,516,517,519,522,525,528,530,533],{"class":273,"line":274},[271,518,403],{"class":280},[271,520,521],{"class":406},"script",[271,523,524],{"class":277}," setup",[271,526,527],{"class":277}," lang",[271,529,416],{"class":280},[271,531,532],{"class":419},"\"ts\"",[271,534,535],{"class":280},">\n",[271,537,538,542,545,548,551],{"class":273,"line":284},[271,539,541],{"class":540},"szBVR","import",[271,543,544],{"class":540}," type",[271,546,547],{"class":280}," { PlotColors } ",[271,549,550],{"class":540},"from",[271,552,553],{"class":419}," '@edubeam\u002Fplot'\n",[271,555,556],{"class":273,"line":301},[271,557,337],{"emptyLinePlaceholder":336},[271,559,560,563,566,569,572,574,577,580,582],{"class":273,"line":314},[271,561,562],{"class":540},"const",[271,564,565],{"class":294}," print",[271,567,568],{"class":540},":",[271,570,571],{"class":277}," Partial",[271,573,403],{"class":280},[271,575,576],{"class":277},"PlotColors",[271,578,579],{"class":280},"> ",[271,581,416],{"class":540},[271,583,281],{"class":280},[271,585,586,589,592,594,597,600,603,606,608],{"class":273,"line":327},[271,587,588],{"class":280},"  ink: ",[271,590,591],{"class":419},"'#000'",[271,593,441],{"class":280},[271,595,596],{"class":419},"'#fff'",[271,598,599],{"class":280},", muted: ",[271,601,602],{"class":419},"'#555'",[271,604,605],{"class":280},", brand: ",[271,607,591],{"class":419},[271,609,610],{"class":280},",\n",[271,612,613,616,618,621,623,626,628,631,633],{"class":273,"line":333},[271,614,615],{"class":280},"  normal: ",[271,617,591],{"class":419},[271,619,620],{"class":280},", shear: ",[271,622,591],{"class":419},[271,624,625],{"class":280},", moment: ",[271,627,591],{"class":419},[271,629,630],{"class":280},", deformed: ",[271,632,591],{"class":419},[271,634,610],{"class":280},[271,636,637,640,642,645,647,650,652,655,657],{"class":273,"line":340},[271,638,639],{"class":280},"  load: ",[271,641,591],{"class":419},[271,643,644],{"class":280},", reaction: ",[271,646,591],{"class":419},[271,648,649],{"class":280},", tension: ",[271,651,591],{"class":419},[271,653,654],{"class":280},", compression: ",[271,656,591],{"class":419},[271,658,610],{"class":280},[271,660,661],{"class":273,"line":348},[271,662,330],{"class":280},[271,664,665,668,670],{"class":273,"line":360},[271,666,667],{"class":280},"\u003C\u002F",[271,669,521],{"class":406},[271,671,535],{"class":280},[271,673,674],{"class":273,"line":372},[271,675,337],{"emptyLinePlaceholder":336},[271,677,679,681,684],{"class":273,"line":678},11,[271,680,403],{"class":280},[271,682,683],{"class":406},"template",[271,685,535],{"class":280},[271,687,689,692,694,696,698,700,702,704,706,708,710,712,714,717,719,721,724,726,728,731,733],{"class":273,"line":688},12,[271,690,691],{"class":280},"  \u003C",[271,693,407],{"class":406},[271,695,410],{"class":280},[271,697,413],{"class":277},[271,699,416],{"class":280},[271,701,420],{"class":419},[271,703,413],{"class":280},[271,705,420],{"class":419},[271,707,410],{"class":280},[271,709,387],{"class":277},[271,711,416],{"class":280},[271,713,420],{"class":419},[271,715,716],{"class":280},"print",[271,718,420],{"class":419},[271,720,410],{"class":280},[271,722,723],{"class":277},"animate",[271,725,416],{"class":280},[271,727,420],{"class":419},[271,729,730],{"class":294},"false",[271,732,420],{"class":419},[271,734,452],{"class":280},[271,736,738,740,742],{"class":273,"line":737},13,[271,739,667],{"class":280},[271,741,683],{"class":406},[271,743,535],{"class":280},[14,745,746],{},"The diagrams stay readable without colour: they are hatched, and the moment hangs on the tension side.",[23,748,750],{"id":749},"colours-in-an-svg-file","Colours in an SVG file",[14,752,753,754,761,762,765,766,768],{},"A file written by ",[755,756,758],"a",{"href":757},"\u002Fplot\u002Ffunctions#a-standalone-svg-file",[18,759,760],{},"structureSvg"," has no page around it, so it uses plain colours: ",[18,763,764],{},"PRINT_COLORS",", the EduBeam app's colours on white. Its ",[18,767,387],{}," option takes the same tones as the prop, so the black-and-white set above works there too:",[262,770,774],{"className":771,"code":772,"language":773,"meta":267,"style":267},"language-ts shiki shiki-themes github-light github-dark","structureSvg(model, { colors: print }) \u002F\u002F black on white\nstructureSvg(model, { background: false }) \u002F\u002F no background, for a coloured slide\n","ts",[18,775,776,787],{"__ignoreMap":267},[271,777,778,780,783],{"class":273,"line":274},[271,779,760],{"class":277},[271,781,782],{"class":280},"(model, { colors: print }) ",[271,784,786],{"class":785},"sJ8bj","\u002F\u002F black on white\n",[271,788,789,791,794,796,799],{"class":273,"line":284},[271,790,760],{"class":277},[271,792,793],{"class":280},"(model, { background: ",[271,795,730],{"class":294},[271,797,798],{"class":280}," }) ",[271,800,801],{"class":785},"\u002F\u002F no background, for a coloured slide\n",[14,803,804,805,807],{},"Plain colours only: a ",[18,806,497],{}," means nothing to Word or Inkscape.",[23,809,811],{"id":810},"fonts","Fonts",[14,813,814,815,817,818,820,821,824,825,828],{},"Text uses the page's font, through ",[18,816,245],{}," or ",[18,819,248],{},", with tabular figures. Row names such as V(x) in ",[18,822,823],{},"DiagramStack"," are set in KaTeX's fonts when the page loads them, and in a serif otherwise. An SVG file uses its ",[18,826,827],{},"fontFamily"," option, Helvetica or Arial by default, since it cannot know the page's font.",[23,830,832],{"id":831},"restyling-the-animation","Restyling the animation",[14,834,835,836,839,840,843,844,847],{},"The few CSS rules a plot needs are inlined into each SVG, so it needs no stylesheet. Every class is prefixed ",[18,837,838],{},"ebp-",", and a page can override them. Each layer is a ",[18,841,842],{},"\u003Cg class=\"ebp-layer ebp-layer-{name}\">",", which gets ",[18,845,846],{},"ebp-on"," when it is shown:",[262,849,851],{"className":264,"code":850,"language":266,"meta":267,"style":267},"\u002F* Slower fades, for a lecture hall *\u002F\n.slides .ebp-animate .ebp-layer {\n  transition-duration: 1s;\n}\n",[18,852,853,858,871,886],{"__ignoreMap":267},[271,854,855],{"class":273,"line":274},[271,856,857],{"class":785},"\u002F* Slower fades, for a lecture hall *\u002F\n",[271,859,860,863,866,869],{"class":273,"line":284},[271,861,862],{"class":277},".slides",[271,864,865],{"class":277}," .ebp-animate",[271,867,868],{"class":277}," .ebp-layer",[271,870,281],{"class":280},[271,872,873,876,878,881,884],{"class":273,"line":301},[271,874,875],{"class":294},"  transition-duration",[271,877,291],{"class":280},[271,879,880],{"class":294},"1",[271,882,883],{"class":540},"s",[271,885,298],{"class":280},[271,887,888],{"class":273,"line":314},[271,889,330],{"class":280},[14,891,892,895,896,899,900,904],{},[18,893,894],{},"PLOT_CSS"," exports the inlined rules, and ",[18,897,898],{},"toneVars(colors)"," the custom properties a plot sets on its root element, for building your own figures from the ",[755,901,903],{"href":902},"\u002Fplot\u002Ffunctions#drawing","drawing functions",".",[906,907,908],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":267,"searchDepth":284,"depth":301,"links":910},[911,912,914,915,916,917],{"id":25,"depth":284,"text":26},{"id":383,"depth":284,"text":913},"The colors prop",{"id":505,"depth":284,"text":506},{"id":749,"depth":284,"text":750},{"id":810,"depth":284,"text":811},{"id":831,"depth":284,"text":832},"Colour @edubeam\u002Fplot figures with CSS custom properties or the colors prop: light and dark themes, black-and-white print, SVG colours, fonts, animations.","md",null,{"source":922},"site","\u002Fplot\u002Ftheming",{"title":5,"description":918},"plot\u002Ftheming","stw0DnxMsQGOL7bwgFJ3tbQiK0PpeLAKaMoHbHGS1Jk",[928,932,935,937,938,942,945,948,952,955],{"path":929,"title":930,"order":274,"group":931},"\u002Fplot\u002Fgetting-started","Getting started","Introduction",{"path":933,"title":407,"order":284,"group":934},"\u002Fplot\u002Fstructure-plot","Components",{"path":936,"title":823,"order":301,"group":920},"\u002Fplot\u002Fdiagram-stack",{"path":923,"title":5,"order":314,"group":920},{"path":939,"title":940,"order":327,"group":941},"\u002Fplot\u002Fexercises","Exercises and tests","Use cases",{"path":943,"title":944,"order":333,"group":920},"\u002Fplot\u002Fslides","Slides and notes",{"path":946,"title":947,"order":340,"group":920},"\u002Fplot\u002Fembedding","Embedding",{"path":949,"title":950,"order":348,"group":951},"\u002Fplot\u002Fcomponents","Component API","Reference",{"path":953,"title":954,"order":360,"group":920},"\u002Fplot\u002Fmodel","Plot model",{"path":956,"title":957,"order":372,"group":920},"\u002Fplot\u002Ffunctions","Functions",1795108690567]