[GRASS-dev] Re: [GRASS GIS] #170: r.colors: make nice random colors like r.watershed

GRASS GIS trac at osgeo.org
Mon May 19 04:41:39 EDT 2008


#170: r.colors: make nice random colors like r.watershed
--------------------------+-------------------------------------------------
  Reporter:  hamish       |       Owner:  grass-dev at lists.osgeo.org
      Type:  enhancement  |      Status:  new                      
  Priority:  minor        |   Milestone:  6.4.0                    
 Component:  default      |     Version:  svn-develbranch6         
Resolution:               |    Keywords:  r.colors                 
--------------------------+-------------------------------------------------
Comment (by hamish):

 Replying to [comment:2 glynn]:
 > If I'm reading the code correctly, it creates a set of random
 > colours, then replaces any dark colours with non-random colours
 > selected from generated gradients. IOW, it's a fudge which
 > shouldn't be elevated to a library function.

 ok.
 fwiw I'm looking at a r.watershed map with one color as 27:36:70, fairly
 dark.

 > If you just want to eliminate dark or saturated colours,

 this is the core of the wish I suppose,

 > it would be preferable to add transformation functions to adjust
 > and/or clip the intensity, saturation and hue, which could then
 > be applied to any existing colour rule, not just random colours.

 r.colors -m  # for "mute"
 ?

 It would be a nice excuse to create proper G_hsv2rgb() and G_rgb2hsv()
 fns. ie calculate hue angle using real sine/cosine, not just use the
 hexagon approx to the circle.
 http://www.mandelbrot-dazibao.com/HSV/HSV.htm

 I am also a little confused in my r.cpt2grass GMT color scale -> GRASS
 colr/ rules converter: "value" = 0.0 is white, but is 1.0 black and 0.5
 "maximum"? or is 1.0 full-scale color? Some of the GMT rules
 (/usr/share/gmt/cpt/GMT_topo.cpt) have S all < 0.5 and look washed out
 with my script unless you do S*=2. And another (GMT_sealand.cpt) has value
 all = 1.0, and AFAICT that all becomes black?

 http://article.gmane.org/gmane.comp.gis.grass.user/23635/
 http://trac.osgeo.org/grass/browser/grass-
 addons/raster/r.colors.tools/r.cpt2grass

 Maybe I just have to elevate my brain sugar and study it again.
 (eg mixing up S and V and/or HSV and HIS)

 the wikipedia page on it suggests V=0.0 is white and 1.0 is black.
 http://en.wikipedia.org/wiki/HSL_and_HSV
 shrug.


 but I digress,
 Hamish

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/170#comment:3>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list