Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| metapost [2021/08/26 18:11] – new transparent colors style m | metapost [2024/11/17 06:04] (current) – [Area Symbols] add link to https://colorcodes.io brucemutton | ||
|---|---|---|---|
| Line 224: | Line 224: | ||
| fi; | fi; | ||
| picture thetext; | picture thetext; | ||
| - | thetext: | + | thetext: |
| if A = (-1,1): | if A = (-1,1): | ||
| p_label.ulft(thetext, | p_label.ulft(thetext, | ||
| Line 775: | Line 775: | ||
| Climbing one has center where the rope should go on the harness... | Climbing one has center where the rope should go on the harness... | ||
| The scale on the map and in the legend is matching just for 1:500... | The scale on the map and in the legend is matching just for 1:500... | ||
| + | |||
| + | ===Region names symbol=== | ||
| + | In the Hirlatz cave we use this symbol to tell the name of the adjacent (preview) maps. | ||
| + | It is quite customizable and especially shows a way how to do label boxes. | ||
| + | By default it prints the current surveys name in a white-filled box with rounded corners. | ||
| + | You can adjust it per symbol by giving "-attr <var> < | ||
| + | |||
| + | From Benedikt Hallinger for Therion 6.0.3 | ||
| + | |||
| + | {{ :: | ||
| + | |||
| + | # Symbol to denote assigned survey. | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | def p_u_mappe(expr pos, theta, sc, al) = | ||
| + | T:=identity aligned al rotated theta scaled sc shifted pos; | ||
| + | begingroup; | ||
| + | % Basic config | ||
| + | bordersmooth: | ||
| + | bordermargin: | ||
| + | basescale: | ||
| + | fillsize: | ||
| + | if known(ATTR_bordersmooth): | ||
| + | if known(ATTR_bordermargin): | ||
| + | if known(ATTR_basescale): | ||
| + | if known(ATTR_fillsize): | ||
| + | | ||
| + | % GET LABEL TEXT: | ||
| + | string txt; | ||
| + | if known(ATTR_text): | ||
| + | txt := ATTR_text; | ||
| + | else: | ||
| + | txt := ATTR__survey; | ||
| + | fi; | ||
| + | | ||
| + | | ||
| + | % PREPARE LABEL: | ||
| + | lab: | ||
| + | pickup PenA; % border thickness | ||
| + | interim bboxmargin: | ||
| + | | ||
| + | % PREPARE BOX and DRAW BOX BACKGROUND: | ||
| + | % q is the box as drawed, but we fill the place first before drawing | ||
| + | q:=((bbox lab) smoothed bordersmooth) aligned al scaled (sc * basescale) rotated theta shifted pos; | ||
| + | if (fillsize <> -1.0): | ||
| + | % draw extending filled box around symbol | ||
| + | if known(MapBackground): | ||
| + | % from therion versions newer than 6.0.3+3551531+dev (23.11.2021) we use page background | ||
| + | thfill ((bbox lab) smoothed bordersmooth) scaled (sc * basescale * fillsize) withcolor MapBackground; | ||
| + | else: | ||
| + | thfill ((bbox lab) smoothed bordersmooth) scaled (sc * basescale * fillsize) withcolor label_fill_color; | ||
| + | fi; | ||
| + | fi; | ||
| + | % the following will draw the actual visible interiour-filling of the box | ||
| + | thfill ((bbox lab) smoothed bordersmooth) scaled (sc * basescale) withcolor label_fill_color; | ||
| + | | ||
| + | % DRAW BOX | ||
| + | draw q; | ||
| + | | ||
| + | % DRAW LABEL TEXT | ||
| + | lab:=lab aligned al; | ||
| + | lab:=lab scaled (sc * basescale); | ||
| + | lab:=lab rotated theta; | ||
| + | lab:=lab shifted pos; | ||
| + | process_label(pos, | ||
| + | endgroup; | ||
| + | enddef; | ||
| + | |||
| + | |||
| + | |||
| ====Line Symbols==== | ====Line Symbols==== | ||
| Line 1063: | Line 1136: | ||
| zz3 := postcontrol t of P; | zz3 := postcontrol t of P; | ||
| zz4 := precontrol t+1 of P; | zz4 := precontrol t+1 of P; | ||
| + | linecap_prev: | ||
| linecap:=0; | linecap:=0; | ||
| if (length(zz3-1/ | if (length(zz3-1/ | ||
| Line 1084: | Line 1158: | ||
| draw zz1--zz2 withcolor background; | draw zz1--zz2 withcolor background; | ||
| fi; | fi; | ||
| + | linecap: | ||
| endfor; | endfor; | ||
| enddef; | enddef; | ||
| Line 1622: | Line 1697: | ||
| Colors are in order R, G, B --- 0=0 1=255. Color (0.1, 0.2, 0.8) means (25 51 204) in Photoshop - quite dark blue. Light blue could be for example (123 213 255) in Photoshop - it is (123/255, 213/255, 255/255) or (0.48, 0.84 1.0) for Metapost. | Colors are in order R, G, B --- 0=0 1=255. Color (0.1, 0.2, 0.8) means (25 51 204) in Photoshop - quite dark blue. Light blue could be for example (123 213 255) in Photoshop - it is (123/255, 213/255, 255/255) or (0.48, 0.84 1.0) for Metapost. | ||
| - | See also [[tips#RGB to Therion Colour Mapping Calculator|this spreadsheet]] to visualise and convert between colour formats. | + | See also |
| ---- | ---- | ||