comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Coloring labelled regions (or states)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Coloring labelled regions (or states) [message #92075 is a reply to message #92073] Tue, 06 October 2015 09:20 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>
> Helder writes:
>
>> Thanks David, I'll try that and see. I thought that there would be some clever algorithm based on distances between center of masses and number of neighbors...
>
> I'm sure there is. And, it probably works about as well as assigning
> random colors. :-)

With sufficient colors and a limited number of "connections" between
regions, I can envision an algorithm that removes "neighboring" colors
from a list of colors, before picking one at random. This is guaranteed
to be slow, though, depending upon how many regions you have. And, a lot
of paperwork to keep track of. I'd definitely give random a shot first.

Maybe random with color removal? Assign a random color. Remove that from
the list of colors, assign the next random color from the shortened
list, etc. Rinse and repeat. I can still envision situations that it
wouldn't work with.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: formatting numbers in widget_propertysheet
Next Topic: Geometric mismatch using cgImage and cgDrawShapes

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:08:30 PDT 2025

Total time taken to generate the page: 0.00181 seconds