<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 14, 2014 at 3:03 PM, <span dir="ltr"><<a href="mailto:svn_grass@osgeo.org" target="_blank">svn_grass@osgeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: wenzeslaus<br>
Date: 2014-07-14 12:03:34 -0700 (Mon, 14 Jul 2014)<br>
New Revision: 61255<br>
<br>
Modified:<br>
grass/trunk/gui/wxpython/core/utils.py<br>
Log:<br>
wxGUI/core: use gray always, sync purple with lib/gis/color_str.c although it is probably wrong<br>
<br>
before: depending on dict ordering gray or grey was used, (un)checking Transparent in GUI caused switching from gray to grey<br>
purple: accoring to Wikipedia it is different from violet and was correctly defined in the GUI before but this was not the same as in library<br>
<br>
Modified: grass/trunk/gui/wxpython/core/utils.py<br>
===================================================================<br>
--- grass/trunk/gui/wxpython/core/utils.py 2014-07-14 18:27:46 UTC (rev 61254)<br>
+++ grass/trunk/gui/wxpython/core/utils.py 2014-07-14 19:03:34 UTC (rev 61255)<br>
@@ -945,29 +945,37 @@<br>
# update path<br>
if addonPath not in os.environ['PATH']:<br>
os.environ['PATH'] = addonPath + os.pathsep + os.environ['PATH']<br>
-<br>
-# From lib/gis/col_str.c, except purple which is mentioned<br>
-# there but not given RGB values<br>
+<br>
+<br>
+# predefined colors and their names<br>
+# must be in sync with lib/gis/color_str.c<br>
str2rgb = {'aqua': (100, 128, 255),<br>
'black': (0, 0, 0),<br>
'blue': (0, 0, 255),<br>
'brown': (180, 77, 25),<br>
'cyan': (0, 255, 255),<br>
'gray': (128, 128, 128),<br>
+ 'grey': (128, 128, 128),<br>
'green': (0, 255, 0),<br>
- 'grey': (128, 128, 128),<br>
'indigo': (0, 128, 255),<br>
'magenta': (255, 0, 255),<br>
'orange': (255, 128, 0),<br>
- 'purple': (128, 0, 128),<br>
'red': (255, 0, 0),<br>
'violet': (128, 0, 255),<br>
+ 'purple': (128, 0, 255),<br>
'white': (255, 255, 255),<br>
'yellow': (255, 255, 0)}<br>
rgb2str = {}<br>
-for (s,r) in str2rgb.items():<br>
- rgb2str[ r ] = s<br>
+for (s, r) in str2rgb.items():<br>
+ rgb2str[r] = s<br>
+# ensure that gray value has 'gray' string and not 'grey'<br>
+rgb2str[str2rgb['gray']] = 'gray'<br>
+# purple is defined as nickname for violet in lib/gis<br>
+# (although Wikipedia says that purple is (128, 0, 128))<br>
+# we will prefer the defined color, not nickname<br>
+rgb2str[str2rgb['violet']] = 'violet'<br>
<br></blockquote><div>Has somebody some idea about the purple and violet color definitions (in
lib, formerly in GUI, on Wikipedia) before backport to release branch
7.0? I guess now is the time to change it.<br><br>Wikipedia<br><br>Violet is (127, 0, 255)<br></div><div>Purple is (128, 0, 128)<br><br><a href="http://en.wikipedia.org/wiki/Purple">http://en.wikipedia.org/wiki/Purple</a><br><a href="http://en.wikipedia.org/wiki/Violet_%28color%29">http://en.wikipedia.org/wiki/Violet_%28color%29</a><br><br></div><div>GRASS GIS<br></div><div><br>Violet (128, 0, 255)</div><div>Purple is the same as Violet (in the same manner as Grey is Gray)<br><br><a href="http://trac.osgeo.org/grass/browser/grass/trunk/lib/gis/color_str.c">http://trac.osgeo.org/grass/browser/grass/trunk/lib/gis/color_str.c</a><br><a href="http://trac.osgeo.org/grass/browser/grass/trunk/include/colors.h">http://trac.osgeo.org/grass/browser/grass/trunk/include/colors.h</a><br><a href="http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/core/utils.py#L948">http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/core/utils.py#L948</a><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
def color_resolve(color):<br>
if len(color) > 0 and color[0] in "0123456789":<br>
rgb = tuple(map(int, color.split(':')))<br>
<br>
_______________________________________________<br>
grass-commit mailing list<br>
<a href="mailto:grass-commit@lists.osgeo.org">grass-commit@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-commit" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-commit</a><br>
</blockquote></div><br></div></div>