<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.hoenzb
        {mso-style-name:hoenzb;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Is the only way a to have color with a non-opaque alpha<255 if it was originally entered that way via hex?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Tamas Szekeres [mailto:szekerest@gmail.com]
<br>
<b>Sent:</b> Monday, September 24, 2012 9:34 AM<br>
<b>To:</b> Lime, Steve D (DNR)<br>
<b>Cc:</b> thomas bonfort; mapserver-dev@lists.osgeo.org<br>
<b>Subject:</b> Re: [mapserver-dev] Handling alpha values in colors<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Steve,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Reading alpha values (with hex colors) is already implemented in the code. However we have lack of implementation writing hex colors (in writeColor). We might consider writing the hex format (instead of the integer triplet) when the alpha
 value is in effect (0<= alpha <255) but it may cause a confusuion that setting the opacity of the style causes to write hex colors. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">When reading the mapfiles the opacity value overrides the alpha values specified explicitly (in hex colors).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Best regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Tamas<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2012/9/24 Lime, Steve D (DNR) <<a href="mailto:Steve.Lime@state.mn.us" target="_blank">Steve.Lime@state.mn.us</a>><o:p></o:p></p>
<p class="MsoNormal">I'm guessing it is possible to tweak the parser using re-ahead capabilities. I believe the flex always has the next couple of tokens available for inspection. Haven't done anything like that but I recall reading about it. Will dig out my
 yacc/lex book and confirm.<br>
<br>
Montreal was right at the 6.0 release point so it wasn't something I would have recommended at that late date. Hex color support required no parser changes so was a less risky option at the time.<br>
<span style="color:#888888"><br>
<span class="hoenzb">Steve</span></span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
-----Original Message-----<br>
From: <a href="mailto:mapserver-dev-bounces@lists.osgeo.org">mapserver-dev-bounces@lists.osgeo.org</a> [mailto:<a href="mailto:mapserver-dev-bounces@lists.osgeo.org">mapserver-dev-bounces@lists.osgeo.org</a>] On Behalf Of thomas bonfort<br>
Sent: Sunday, September 23, 2012 5:03 AM<br>
To: Tamas Szekeres<br>
Cc: <a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
Subject: Re: [mapserver-dev] Handling alpha values in colors<br>
<br>
Tamas,<br>
The handling of alphas in colors is a bit flakey, I agree. The initial aim when we worked on this at the montreal code sprint was to drop support of the OPACITY keyword at the STYLE level in the mapserver library (while maintaining it in the parser for backwards
 compatibility), by allowing colors to be specified with quadruplets instead of triplets. I don't rememember the reason (Steve might recollect), but in the end having the parser be able to parse both triplet and quadruplet integers was not possible, and we
 are thus stuck in this less than ideal state.<br>
If someone has a solution for this parser problem that would be great, as it would open up varying opacity for all *COLOR entries.<br>
<br>
regards,<br>
thomas<br>
<br>
On Sun, Sep 23, 2012 at 11:38 AM, Tamas Szekeres <<a href="mailto:szekerest@gmail.com">szekerest@gmail.com</a>> wrote:<br>
> Hi All,<br>
><br>
> I don't properly understand how we intend to handle alpha values of<br>
> colors in mapserver. Currently the alpha values can be specified in<br>
> mapfiles (by using the hexadecimal format), but that values are not<br>
> written back to the file in msSaveMap.<br>
> Style level opacity seems to override alpha values specified in<br>
> mapfiles, but on the other hand we cannot specify opacity at some<br>
> places (like in label text colors).<br>
> By using the opacity values of styles seems to change the alpha values<br>
> of multiple properties (color, outlinecolor, background color etc.)<br>
> which doesn't seems to be as such generic as specifying the alpha<br>
> values for the colors individually.<br>
><br>
> I can also see the conditional compilation flag ALPHACOLOR_ENABLED in<br>
> the code, but it doesn't have much effect for the operation.<br>
><br>
> Could someone explain how the things are expected to work?<br>
><br>
> Best regards,<br>
><br>
> Tamas<br>
><br>
> _______________________________________________<br>
> mapserver-dev mailing list<br>
> <a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">
http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
><br>
_______________________________________________<br>
mapserver-dev mailing list<br>
<a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
<br>
<o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>