<html><body><div>There is transparency parameter in MetaPost:</div><div><br data-mce-bogus="1"></div><div><h2 style="color: #336644; background-image: none; margin: 1em 0px 0.6em; padding-top: 0.5em; padding-bottom: 0.1em; border: none; font-size: 18px; font-family: Verdana, 'DejaVu Sans', sans-serif; line-height: 19.5px;" data-mce-style="color: #336644; background-image: none; margin: 1em 0px 0.6em; padding-top: 0.5em; padding-bottom: 0.1em; border: none; font-size: 18px; font-family: Verdana, 'DejaVu Sans', sans-serif; line-height: 19.5px;"><span class="mw-headline" id="Transparent_colors">Transparent colors </span></h2><p style="margin: 0.3em 0px 0.5em; line-height: 1.3em; font-family: Verdana, 'DejaVu Sans', sans-serif; font-size: 13px;" data-mce-style="margin: 0.3em 0px 0.5em; line-height: 1.3em; font-family: Verdana, 'DejaVu Sans', sans-serif; font-size: 13px;">You can use transparent colors with the <code style="background-color: #f7f7f7; font-family: 'DejaVu Sans Mono', 'Lucida Grande', 'Lucida Console', monospace;" data-mce-style="background-color: #f7f7f7; font-family: 'DejaVu Sans Mono', 'Lucida Grande', 'Lucida Console', monospace;">transparent(method, factor, color)</code> function. For example:</p><pre class="tex" style="font-family: 'DejaVu Sans Mono', 'Lucida Grande', 'Lucida Console', monospace; padding: 1em; border: none; line-height: 1.5em; font-size: 0.85em; background-color: #eaf0e0; overflow: auto;" data-mce-style="font-family: 'DejaVu Sans Mono', 'Lucida Grande', 'Lucida Console', monospace; padding: 1em; border: none; line-height: 1.5em; font-size: 0.85em; background-color: #eaf0e0; overflow: auto;"><span class="cs" style="color: #0000ff;" data-mce-style="color: #0000ff;">\runMPgraphicstrue</span>
<span class="cs" style="color: #0000ff;" data-mce-style="color: #0000ff;">\setupcolors</span><span class="br" style="color: red;" data-mce-style="color: red;">[</span>state=start<span class="br" style="color: red;" data-mce-style="color: red;">]</span>
<span class="cs" style="color: #0000ff;" data-mce-style="color: #0000ff;">\starttext</span>
<span class="cs" style="color: #0000ff;" data-mce-style="color: #0000ff;">\startreusableMPgraphic</span><span class="br" style="color: red;" data-mce-style="color: red;">{</span>a<span class="br" style="color: red;" data-mce-style="color: red;">}</span>
fill unitsquare scaled 1cm withcolor yellow;
fill unitsquare shifted <span class="br" style="color: red;" data-mce-style="color: red;">(</span>0.5,0.5<span class="br" style="color: red;" data-mce-style="color: red;">)</span>
  <span class="comment" style="font-style: italic; color: #333333;" data-mce-style="font-style: italic; color: #333333;">% method 1 = normal</span>
  scaled 1cm withcolor transparent<span class="br" style="color: red;" data-mce-style="color: red;">(</span>1,0.5,red<span class="br" style="color: red;" data-mce-style="color: red;">)</span>;
<span class="cs" style="color: #0000ff;" data-mce-style="color: #0000ff;">\stopreusableMPgraphic</span>

<span class="cs" style="color: #0000ff;" data-mce-style="color: #0000ff;">\placefigure</span><span class="br" style="color: red;" data-mce-style="color: red;">[</span>force,none<span class="br" style="color: red;" data-mce-style="color: red;">]</span><span class="br" style="color: red;" data-mce-style="color: red;">{</span><span class="br" style="color: red;" data-mce-style="color: red;">}</span><span class="br" style="color: red;" data-mce-style="color: red;">{</span><span class="cs" style="color: #0000ff;" data-mce-style="color: #0000ff;">\reuseMPgraphic</span><span class="br" style="color: red;" data-mce-style="color: red;">{</span>a<span class="br" style="color: red;" data-mce-style="color: red;">}</span><span class="br" style="color: red;" data-mce-style="color: red;">}</span>
<span class="cs" style="color: #0000ff;" data-mce-style="color: #0000ff;">\stoptext</span>
</pre><img src="http://wiki.contextgarden.net/wikiteximage/b0adbcce49afb2e49c30b61d63119729.png" data-mce-src="http://wiki.contextgarden.net/wikiteximage/b0adbcce49afb2e49c30b61d63119729.png"><span style="font-family: Verdana, 'DejaVu Sans', sans-serif; font-size: 13px; line-height: 19.5px;" data-mce-style="font-family: Verdana, 'DejaVu Sans', sans-serif; font-size: 13px; line-height: 19.5px;"></span><p style="margin: 0.3em 0px 0.5em; line-height: 1.3em; font-family: Verdana, 'DejaVu Sans', sans-serif; font-size: 13px;" data-mce-style="margin: 0.3em 0px 0.5em; line-height: 1.3em; font-family: Verdana, 'DejaVu Sans', sans-serif; font-size: 13px;">The available transparency methods are the twelve methods supported by PDF specification:</p><ul style="line-height: 19.5px; list-style-type: square; margin: 0.3em 0px 0px 1.5em; padding: 0px; list-style-image: url('http://wiki.contextgarden.net/skins/contextskin/images/bullet-icon.png'); font-family: Verdana, 'DejaVu Sans', sans-serif; font-size: 13px;" data-mce-style="line-height: 19.5px; list-style-type: square; margin: 0.3em 0px 0px 1.5em; padding: 0px; list-style-image: url('http://wiki.contextgarden.net/skins/contextskin/images/bullet-icon.png'); font-family: Verdana, 'DejaVu Sans', sans-serif; font-size: 13px;"><li style="margin-bottom: 0.1em;" data-mce-style="margin-bottom: 0.1em;">1. normal </li><li style="margin-bottom: 0.1em;" data-mce-style="margin-bottom: 0.1em;">2. multiply </li><li style="margin-bottom: 0.1em;" data-mce-style="margin-bottom: 0.1em;">3. screen </li><li style="margin-bottom: 0.1em;" data-mce-style="margin-bottom: 0.1em;">4. overlay</li><li style="margin-bottom: 0.1em;" data-mce-style="margin-bottom: 0.1em;">5. softlight </li><li style="margin-bottom: 0.1em;" data-mce-style="margin-bottom: 0.1em;">6. hardlight </li><li style="margin-bottom: 0.1em;" data-mce-style="margin-bottom: 0.1em;">7. colordodge </li><li style="margin-bottom: 0.1em;" data-mce-style="margin-bottom: 0.1em;">8. colorburn</li><li style="margin-bottom: 0.1em;" data-mce-style="margin-bottom: 0.1em;">9. darken </li><li style="margin-bottom: 0.1em;" data-mce-style="margin-bottom: 0.1em;">10. lighten </li><li style="margin-bottom: 0.1em;" data-mce-style="margin-bottom: 0.1em;">11. difference </li><li style="margin-bottom: 0.1em;" data-mce-style="margin-bottom: 0.1em;">12. exclusion</li><li></li></ul></div><div><br>On Jul 19, 2016, at 12:25 PM, Robert Staven <robert@staven.no> wrote:<br><br></div><div><blockquote type="cite"><div class="msg-quote"><div class="_stretch"><span class="body-text-content">Hi,<br><br>I'm using Therion to map waterfilled caves, and some systems have <br>'air-locks' (air chambers), so it's necessary to distinguish between air <br>filled cave, waterfilled cave and water surfaces. But the waterfilled <br>area should show details (be transparent) in same way as dry cave.<br><br>Is there any way to adjust the opacity value (in meta code?) when <br>setting a transparent color?<br><br><br>I have made a test to show my issues:<br>The files can be found on <a href="http://www.staven.no/cavetest/" data-mce-href="http://www.staven.no/cavetest/">http://www.staven.no/cavetest/</a><br><br><br>The cave (ca 100m long)<br>plan:<br>-> <a href="http://www.staven.no/cavetest/testcave_plan.pdf" data-mce-href="http://www.staven.no/cavetest/testcave_plan.pdf">http://www.staven.no/cavetest/testcave_plan.pdf</a><br>elevation:<br>-> <a href="http://www.staven.no/cavetest/testcave_elevation.pdf" data-mce-href="http://www.staven.no/cavetest/testcave_elevation.pdf">http://www.staven.no/cavetest/testcave_elevation.pdf</a><br><br>This doesn't work to well draw underwater maps.<br><br><br>*** Changing the water color:<br><br>layout test<br> code metapost<br><br> def a_water (expr p) =<br> T:=identity;<br> thfill p withcolor (0.8, 0.8, 1.0);<br> enddef;<br><br> endcode<br>endlayout<br><br>-> <a href="http://www.staven.no/cavetest/testcave_elevation_2.pdf" data-mce-href="http://www.staven.no/cavetest/testcave_elevation_2.pdf">http://www.staven.no/cavetest/testcave_elevation_2.pdf</a><br><br>Looks better but the cave and line 'behind' doesn't show thru the water.<br><br><br>*** Try with transparent water color:<br><br> def_transparent_rgb(tr_lblue, 0.80, 0.80, 1.00);<br><br> def a_water (expr p) =<br> T:=identity;<br> thfill p withtransparentcolor tr_lblue;<br> enddef;<br><br>-> <a href="http://www.staven.no/cavetest/testcave_elevation_3.pdf" data-mce-href="http://www.staven.no/cavetest/testcave_elevation_3.pdf">http://www.staven.no/cavetest/testcave_elevation_3.pdf</a><br><br><br>*** Almost perfect, but I like to adjust the opacity value so it looks <br>like this:<br><br> def a_water (expr p) =<br> T:=identity;<br> enddef;<br> # no drawing of water<br><br> color map-fg [80 80 100]<br><br>-> <a href="http://www.staven.no/cavetest/testcave_elevation_4.pdf" data-mce-href="http://www.staven.no/cavetest/testcave_elevation_4.pdf">http://www.staven.no/cavetest/testcave_elevation_4.pdf</a><br>(NB You won't see the difference in Adobe Reader, but it shows up in <br>SumatraPDF)<br><br><br>Is there any way to adjust the opacity value when setting a transparent <br>color?<br><br>Or should I do this another way?<br>_______________________________________________<br>Therion mailing list<br><a href="mailto:Therion@speleo.sk" data-mce-href="mailto:Therion@speleo.sk">Therion@speleo.sk</a><br><a href="http://mailman.speleo.sk/listinfo/therion" data-mce-href="http://mailman.speleo.sk/listinfo/therion">http://mailman.speleo.sk/listinfo/therion</a><br></span></div></div></blockquote></div></body></html>