[vtk-developers] Interest in a vtkColor class?

Andrew Maclean a.maclean at cas.edu.au
Fri Mar 25 18:38:00 EST 2005


It is quite easy to do this. 

I have looked at the paper and also done a search of various other sites on
the web and I now have a list of about 700 named colours after eliminating
redundancies. This includes gray 0 to gray 100 along with (grey 0 to grey
100) [this accounts for 200 "colors"]. Eliminating redundancies was a little
difficult because the same colour often had different names.  I also got rid
of capitalization and replaced underscores by spaces so "AliceBlue",
"aliceblue", "alice_blue" all became "alice blue". However for some reason
"peru" didn't get into my list :-).  Interestingly all the published colour
names seem to have a common origin in that file called "rgb.txt" - people
have just added names or changed case.

 

 By using an STL map, duplicate colour values are not a problem because I am
using the names as keys. It is also possible to reverse search on colour
values and get a names.

 

So if people have a preference for capitalized names and no spaces, I'll
change this.

 

Andrew

 

 

  _____  

From: David Cole [mailto:david.cole at kitware.com] 
Sent: Saturday, 26 March 2005 02:43
To: Lorensen, William E (Research)
Cc: Andrew Maclean; Brad King; vtk-developers at vtk.org; Mathieu Malaterre
Subject: Re: [vtk-developers] Interest in a vtkColor class?

 

Just one more suggestion regarding the color topic:

Consider supporting "Recognized color keyword names" (Section 4.2 of
http://www.w3.org/TR/SVG/types.html) as a base set of "pre-defined" colors.
Alternatively, perhaps there's some other already defined standard that
might be more appropriate in VTK's case. Remarkably, the "named colors"
found in Microsoft's .NET framework System.Drawing.Colors, the KnownColor
enumeration, appear to be derived largely from the SVG named colors... Or
perhaps it's just coincidence that the lists both begin with AliceBlue,
AntiqueWhite, Aqua and Aquamarine... :-)


David


Lorensen, William E (Research) wrote: 

itk has started using the Wiki to discuss enhancements and additions to itk.
http://www.itk.org/Wiki/ITK_Oversight_Committee
 
The use of the Wiki for proposed extensions is just an experiment. Also, itk
has an oversight committee that reviews proposals and APIP changes. This is
also new and in the formative stages.
 
The nice thing about the Wiki (over mailing lists) is that it serves as a
record of the proposal discussion and refinement. Look at the on-going
proposal for supporting orientation in images...
 
http://www.itk.org/Wiki/Proposals:Orientation
 
Bill
 
 
-----Original Message-----
From: vtk-developers-bounces at vtk.org
[mailto:vtk-developers-bounces at vtk.org]On Behalf Of Andrew Maclean
Sent: Tuesday, March 22, 2005 5:01 PM
To: 'Brad King'
Cc: vtk-developers at vtk.org; 'Mathieu Malaterre'
Subject: RE: [vtk-developers] Interest in a vtkColor class?
 
 
Ok.
 
Andrew
 
 
 
-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com] 
Sent: Wednesday, 23 March 2005 00:17
To: Andrew Maclean
Cc: 'Mathieu Malaterre'; vtk-developers at vtk.org
Subject: Re: [vtk-developers] Interest in a vtkColor class?
 
Andrew Maclean wrote:
  

Thanks for your comments. I just wanted something in a class that doesn't
add a whole mass of static variables and also gives the user the ability
    

to
  

add new colours to their tables. The values of the colours won't change in
the map but the user can add new colours or delete if they want. Someone
might want "alizarin purple"!
 
If no-one thinks this is of any use and maybe my solution is probably a
    

bit
  

too sophisticated, could we perhaps just rename vtkTestingColors.h to say
vtkColors.h and move it into Commmon? This would be quite useful. I would
    

be
  

quite happy with this approach. 
 
This has just been motivated because I like to be able to set the same
colours in the TCL scripts and in the C++ code. Also when given an option
for colours, users often remember names better. I have a colour combo-box
    

in
  

windows that lets the user select a named colour patch or make their own
colour. Hence the motivation for a map of colours keyed by name.
    

 
Having a vtkColor generation class is certainly a reasonable idea.  If 
you implement one please post the interface to this list for 
comments/discussion.  Once it is finished you can submit a feature 
request here:
 
http://www.vtk.org/Bug
 
and then go back in and add the source files to the report.
 
-Brad
 
 
_______________________________________________
vtk-developers mailing list
vtk-developers at vtk.org
http://www.vtk.org/mailman/listinfo/vtk-developers
_______________________________________________
vtk-developers mailing list
vtk-developers at vtk.org
http://www.vtk.org/mailman/listinfo/vtk-developers
 
 
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20050326/699013bf/attachment.html>


More information about the vtk-developers mailing list