Color constant to/from string?
- 
					
					
					
					
 Hi! Just a quick question: Is there a way to get the name (as a string) of a particular color constant? 
 And the other way around, can you go from a string color name to the corresponding constant?I could not find anything in the help about this... 
- 
					
					
					
					
 Print(red) 
 Will show you the vector rgba
 Red 1.000
 Green 0.000
 Blue 0.000
 Alpha 1.000 transparency
 I don't think you can go the other way unless you made your own list and put it in a function
- 
					
					
					
					
 Thanks. I was more looking for something like Print(convertToStr(red))which would give me the output: 
 redand then something like Print(convertToColor("red"))which would output something like: 
 1.0000, 0.0000, 0.0000, 0.0000(...that is the color rgba vector for red). 
- 
					
					
					
					
 How many colors ? 
- 
					
					
					
					
 @vinicity I don't think there is a way currently. Leave it with me and I'll see if I can do a user function 
- 
					
					
					
					
 You might run into trouble just looked at the color section and thought 
 Maroon
 Darkred
 And burgundy looked pretty similar
 Tried all three and burgundy doesn't exist
 It looks like they've named about a hundred colors out of a possible (2 to the power 24)
- 
					
					
					
					
 Yes this will only work for colo(u)rs with defined constants. I think burgundy was a typo it is in as burgandy 
- 
					
					
					
					
 Burgandy doesn't work either 
- 
					
					
					
					
 It is not syntax highlighting but it is displaying OK: loop clear(burgandy) update() repeat
- 
					
					
					
					
 @pianofire Thanks! 
- 
					
					
					
					
 @vinicity Here you go try this: https://fuzearena.com/forum/topic/957/functions-to-convert-from-a-string-to-a-colour-constant-and-vice-versa Let me know if you find any problems 
- 
					
					
					
					
 @pianofire Thanks a lot! Exactly what I needed! 
 
			
		 
			
		