MarginallyClever / Makelangelo-software

Software for plotters - especially the wall-hanging polargraph also called Makelangelo.

Home Page:http://www.marginallyclever.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a color value association to color name does not match w3c color name for green...

PPAC37 opened this issue · comments

if we want to name the color as in https://www.w3.org/TR/css-color-3/#svg-color

private static String getColorName(int toolNumber) {
String name = "";
switch (toolNumber) {
case 0xff0000:
name = "red";
break;
case 0x00ff00:
name = "green";
break;

		case 0x00ff00:// = w3c "lime" https://www.w3.org/TR/css-color-3/#normative
			name = "lime";
			break;
		case 0x008000:// = w3c "green" https://www.w3.org/TR/css-color-3/#normative
			name = "green";
			break;

yes it's not a big deal but ...

You think of color sets that match some theme ?
like "christmas" = { "red", "green", "white", ... }
and
image

Or a way to present / group the colors that would be close to each other in a color chart ?
( a bit like what is done on https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color )

No... I was thinking more like official color codes from pen makers. copic, staedler (can't find), and pantone.

It's an idea, but need to ask for permission unless free to use their associated name / color list ... from what I can read,
https://fr.wikipedia.org/wiki/Pantone_(company)
"Pantone's color list is subject to intellectual property rights (as a copyright and not as a software patent) and is therefore not free to use, which is why Pantone values are not available in free software such as GNU Image Manipulation Program (GIMP)."

maybe there is a way around this, like making a voluntary typo so that it is not exactly the same name but that it is easily guessed like Bleu => BeBleu , Red => ReRed? ;)

why not just the name as defined in the w3c ? no copyright problem and names on the list are already chosen...

Yes to use W3C color naming.
It will just be necessary to agree on when there are several names for the same value which one is used.

ex :


 case 0x00ffff: name = "aqua"; // [aqua, cyan]
break;

 case 0xff00ff: name = "fuchsia"; // [fuchsia, magenta]
break;

 case 0x808080: name = "gray"; // [gray, grey]
break;

 case 0x2f4f4f: name = "darkslategray"; // [darkslategray, darkslategrey]
break;
 case 0x696969: name = "dimgray"; // [dimgray, dimgrey]
break;
 case 0x708090: name = "slategray"; // [slategray, slategrey]
break;
 case 0x778899: name = "lightslategray"; // [lightslategray, lightslategrey]
break;
 case 0xa9a9a9: name = "darkgray"; // [darkgray, darkgrey]
break;
 case 0xd3d3d3: name = "lightgray"; // [lightgray, lightgrey]
break;

f407046 introduced com.marginallyclever.convenience.SVGColorNames which contains all the W3C basic and extended named colors. I will use this to find the names of each color instead of the switch above. addressed in #655