EEVblog Electronics Community Forum

Products => Computers => Programming => Topic started by: Lord of nothing on December 06, 2020, 09:18:12 am

Title: Colour Names in Austrian and English?!
Post by: Lord of nothing on December 06, 2020, 09:18:12 am
Hi
Maybe some know: https://en.wikipedia.org/wiki/Web_colors#Extended_colors
What I looking for is a way to combine multiple different Data into one DB.
Sadly I must deal often with Multi Language Contend. So one problem is the Colour (Names) of some Product. I need to convert the colour in a rough Main Colour. So when someone looking for a Red Cable all different Red shades are include.
Where could I find Austrian Name for the Hex Values?
Thanks
Title: Re: Colour Names in Austrian and English?!
Post by: Nominal Animal on December 06, 2020, 05:49:53 pm
Obligatory XKCD (https://blog.xkcd.com/2010/05/03/color-survey-results/).

I thought the official language of Austria was German?  :-//

A quick web search found this (https://www.code-knacker.de/farbnamen.htm).  Hope this helps..
Title: Re: Colour Names in Austrian and English?!
Post by: Lord of nothing on December 06, 2020, 06:38:49 pm
 ;) its DE-AT and yes we have our own Dictionary: https://en.wikipedia.org/wiki/%C3%96sterreichisches_W%C3%B6rterbuch
Beside of that there are the English names for the Hex Values. Well I would like have the Austrian to but I could not find them?!
Title: Re: Colour Names in Austrian and English?!
Post by: golden_labels on December 06, 2020, 07:52:33 pm
Just store multiple keys with the same color value.

On to of that you may also associate each entry with the relevant locale identifier. That has a few benefits:
Title: Re: Colour Names in Austrian and English?!
Post by: Nominal Animal on December 06, 2020, 08:26:46 pm
;) its DE-AT and yes we have our own Dictionary: https://en.wikipedia.org/wiki/%C3%96sterreichisches_W%C3%B6rterbuch (https://en.wikipedia.org/wiki/%C3%96sterreichisches_W%C3%B6rterbuch)
Right; I didn't realize that, sorry.

Here's the English-German table in pipe-separated format stolen from the link I posted (https://www.code-knacker.de/farbnamen.htm):
Code: [Select]
aliceblue|eisfarben|240,248,255|#f0f8ff
antiquewhite|Antikweiß|250,235,215|#faebd7
aqua|Wasser (aqua = cyan)|0,255,255|#00ffff
aquamarine|Aquamarinblau|127,255,212|#7fffd4
azure|Himmelblau|240,255,255|#f0ffff
beige|Beige|245,245,220|#f5f5dc
bisque|Biskuit|255,228,196|#ffe4c4
black|Schwarz|0,0,0|#000000
blanchedalmond|Mandelweiß|255,235,205|#ffebcd
blue|Blau|0,0,255|#0000ff
blueviolet|Blauviolett|138,43,226|#8a2be2
brown|Braun|165,42,42|#a52a2a
burlywood|Gelbbraun|222,184,135|#deb887
cadetblue|Kadettenblau|95,158,160|#5f9ea0
chartreuse|Hellgrün|127,255,0|#7fff00
chocolate|Schokolade|210,105,30|#d2691e
coral|Koralle|255,127,80|#ff7f50
cornflowerblue|Kornblumenblau|100,149,237|#6495ed
cornsilk|Mais|255,248,220|#fff8dc
crimson|Karmesinrot|220,20,60|#dc143c
cyan|Türkis (cyan = aqua)|0,255,255|#00ffff
darkblue|Dunkelblau|0,0,139|#00008b
darkcyan|Dunkeltürkis|0,139,139|#008b8b
darkgoldenrod|dunkle Goldrutenfarbe|184,134,11|#b8860b
darkgreen|Dunkelgrün|0,100,0|#006400
darkgrey|Dunkelgrau|169,169,169|#a9a9a9
darkkhaki|Dunkelkhaki|189,183,107|#bdb76b
darkmagenta|Dunkelmagenta|139,0,139|#8b008b
darkolivegreen|dunkles Olivgrün|85,107,47|#556b2f
darkorange|dunkles Orange|255,140,0|#ff8c00
darkorchid|dubkle Orchidee|153,50,204|#9932cc
darkred|Dunkelrot|139,0,0|#8b0000
darksalmon|dunkle Lachsfarbe|233,150,122|#e9967a
darkseagreen|dunkles Seegrün|143,188,143|#8fbc8f
darkslateblue|dunkles Schieferblau|72,61,139|#483d8b
darkslategrey|dunkles Schiefergrau|47,79,79|#2f4f4f
darkturquoise|Dunkeltürkis|0,206,209|#00ced1
darkviolet|Dunkelvilolett|148,0,211|#9400d3
deeppink|Tiefrosa|255,20,147|#ff1493
deepskyblue|tiefes Himmelblau|0,191,255|#00bfff
dimgrey|Dunkelgrau|105,105,105|#696969
dodgerblue|Persenningblau|30,144,255|#1e90ff
firebrick|Backstein|178,34,34|#b22222
floralwhite|Blütenweiß|255,250,240|#fffaf0
forestgreen|Waldgrün|34,139,34|#228b22
fuchsia|Fuchsie (fuchsia = magenta)|255,0,255|#ff00ff
gainsboro|Gainsboro|220,220,220|#dcdcdc
ghostwhite|Geisterweiß|248,248,255|#f8f8ff
gold|Gold|255,215,0|#ffd700
goldenrod|Goldrute|218,165,32|#daa520
gray|Grau|128,128,128|808080
green|Grün|0,128,0|#008000
greenyellow|Grüngelb|173,255,47|#adff2f
grey|Grau|128,128,128|808080
honeydew|Honigmelone|240,255,240|#f0fff0
hotpink|leuchtendes Rosa|255,105,180|#ff69b4
indianred|Indischrot|205,92,92|#cd5c5c
indigo|Indigo|75,0,130|#4b0082
ivory|Elfenbein|255,255,240|#fffff0
khaki|staubfarben|240,230,140|#f0e68c
lavender|Lavendel|230,230,250|#e6e6fa
lavenderblush|Lavendelrosa|255,240,245|#fff0f5
lawngreen|Rasengrün|124,252,0|#7cfc00
lemonchiffon|Chiffongelb|255,250,205|#fffacd
lightblue|Hellblau|173,216,230|#add8e6
lightcoral|helles Korallenrot|240,128,128|#f08080
lightcyan|helles Cyan|224,255,255|#e0ffff
lightgoldenrodyellow|helles Goldrutengelb|250,250,210|#fafad2
lightgray|Hellgrau|211,211,211|#d3d3d3
lightgreen|Hellgrün|144,238,144|#90ee90
lightpink|Hellrosa|255,182,193|#ffb6c1
lightsalmon|helle Lachsfarbe|255,160,122|#ffa07a
lightseagreen|helles Seegrün|32,178,170|#20b2aa
lightskyblue|helles Himmelblau|135,206,250|#87cefa
lightslategrey|helles Schiefergrau|119,136,153|#778899
lightsteelblue|helles Stahlblau|176,196,222|#b0c4de
lightyellow|Hellgelb|255,255,224|#ffffe0
lime|Limone|0,255,0|#00ff00
limegreen|Limonengrün|50,205,50|#32cd32
linen|Leinen|250,240,230|#faf0e6
magenta|Magenta (magenta = fuchsia)|255,0,255|#ff00ff
maroon|Kastanie|128,0,0|#800000
mediumaquamarine|mittleres Aquamarin|102,205,170|#66cdaa
mediumblue|mittleres Blau|0,0,205|#0000cd
mediumorchid|mittlere Orchedee|186,85,211|#ba55d3
mediumpurple|mittleres Violett|147,112,219|#9370db
mediumseagreen|mittleres Seegrün|60,179,113|#3cb371
mediumslateblue|mittleres Schieferblau|#,104,238|#7b68ee
mediumspringgreen|mittleres Frühlingsgrün|0,250,154|#00fa9a
mediumturquoise|mittlere Türkis|72,209,204|#48d1cc
mediumvioletred|mittleres Violettrot|199,21,133|#c71585
midnightblue|Mitternachtsblau|25,25,112|#191970
mintcream|cremige Minze|245,255,250|#f5fffa
mistyrose|altrosa|255,228,225|#ffe4e1
moccasin|Mokassin|255,228,181|#ffe4b5
navajowhite|Navajoweiß|255,222,173|#ffdead
navy|Marinenblau|0,0,128|#000080
oldlace|alte Spitze|253,245,230|#fdf5e6
olive|Olivgrün|128,128,0|#808000
olivedrab|Olivgraubraun|107,142,35|#6b8e23
orange|Orange|255,165,0|#ffa500
orangered|Orangerot|255,69,0|#ff4500
orchid|Orchidee|218,112,214|#da70d6
palegoldenrod|blasse Goldrutenfarbe|238,232,170|#eee8aa
palegreen|Blassgrün|152,251,152|#98fb98
paleturquoise|Blasstürkis|175,238,238|#afeeee
palevioletred|blasses Violettrot|219,112,147|#db7093
papayawhip|Papayacreme|255,239,213|#ffefd5
peachpuff|Pfirsich|255,218,185|#ffdab9
peru|Peru|205,133,63|#cd853f
pink|Rosa|255,192,203|#ffc0cb
plum|Pflaume|221,160,221|#dda0dd
powderblue|Taubenblau|176,224,230|#b0e0e6
purple|Violett|128,0,128|#800080
red|Rot|255,0,0|#ff0000
rosybrown|rosiges Braun|188,143,143|#bc8f8f
royalblue|Königsblau|65,105,225|#4169e1
saddlebrown|Sattelbraun|139,69,19|#8b4513
salmon|lachsfarben|250,128,114|#fa8072
sandybrown|Sandbraun|244,164,96|#f4a460
seagreen|Seegrün|46,139,87|#2e8b57
seashell|Muschel|255,245,238|#fff5ee
sienna|Siennaerde|160,82,45|#a0522d
silver|Silber|192,192,192|#c0c0c0
skyblue|Himmelblau|135,206,235|#87ceeb
slateblue|Schieferblau|106,90,205|#6a5acd
slategrey|Schiefergrau|112,128,144|#708090
snow|Schneeweiß|255,250,250|#fffafa
springgreen|Frühlingsgrün|0,255,127|#00ff7f
steelblue|Stahlblau|70,130,180|#4682b4
tan|hautfarben|210,180,140|#d2b48c
teal|Krickentengrün|0,128,128|#008080
thistle|Distel|216,191,216|#d8bfd8
tomato|Tomate|255,99,71|#ff6347
turquoise|Türkis|64,224,208|#40e0d0
violet|Veilchen|238,130,238|#ee82ee
wheat|Weizen|245,222,179|#f5deb3
white|Weiß|255,255,255|#ffffff
whitesmoke|rauchfarben|245,245,245|#f5f5f5
yellow|Gelb|255,255,0|#ffff00
yellowgreen|Gelbgrün|154,205,50|#9acd32

Personally, I like to do a "normalization" on the input first, converting variants like üäö -> uao and all to lower case, before doing a match.  From the above, you'd have white=#ffffff for English, and weiss=#ffffff (plus perhaps weisz=#ffffff) for German, to compare the "normalized" inputs to.  While it isn't "proper", it is the best way I've found for name matching to work for us humans.

I haven't found a similar list for Austrian.  Is there an online German-Austrian or English-Austrian dictionary you could scrape the color names?
Title: Re: Colour Names in Austrian and English?!
Post by: indeterminatus on December 06, 2020, 08:57:03 pm
Assuming that it's just the display values you are looking for, I'd go with the German ones, I wouldn't know of any "official" names specific to us Austrians (but hey, if someone jumps in, I'm eager to learn about them as well).
Title: Re: Colour Names in Austrian and English?!
Post by: Nominal Animal on December 06, 2020, 10:15:13 pm
If one wants to do the inverse, i.e. find the best matching human-readable name for a color specified as RGB components, do not use RGB with Euclidean distance squared, i.e. (R-r)2+(G-g)2+(B-b)2, as a similarity measure.  It behaves poorly.  See e.g Wikipedia article on color difference (https://en.wikipedia.org/wiki/Color_difference) for details.

Because we do not have color calibration information (i.e., information enough to convert to CIELAB or derivatives), using the lossless conversion from RGB to YCbCr (https://en.wikipedia.org/wiki/YCbCr#JPEG_conversion) like JPEG uses, and then Euclidean distance squared in Y, Cb, and Cr coordinates, is already much better.

If we assume RGB=sRGB – and I think we should, but others might disagree! –, we can convert to CIEXYZ (https://en.wikipedia.org/wiki/SRGB#The_reverse_transformation), and from there to CIELAB (https://en.wikipedia.org/wiki/CIELAB_color_space#Converting_between_CIELAB_and_CIEXYZ_coordinates) (and use Euclidean distance squared in CIELAB color coordinates for the similarity measure), or if you have graphics artists etc. as clients, to CIECAM02 (https://en.wikipedia.org/wiki/CIECAM02).  (When, not if, they complain, you have a standard reference they can rely on to describe the reasoning.)
You only need to convert the known color names' once, and each RGB color to be found, so this is really not much computation at all.
When you have dozens or more colors, this really does yield visually much better matches.
Title: Re: Colour Names in Austrian and English?!
Post by: AntiProtonBoy on December 06, 2020, 10:25:06 pm
Instead of dealing with complicated CIE colour transforms, why not convert colours to HSL and classify colours based on Hue?
Title: Re: Colour Names in Austrian and English?!
Post by: Nominal Animal on December 06, 2020, 10:40:24 pm
Instead of dealing with complicated CIE colour transforms, why not convert colours to HSL and classify colours based on Hue?
That won't differentiate "dark" and "light" variants of the same color, for example "brown" and "orange" (having the same hue coordinate).

The conversion from RGB is simple (https://en.wikipedia.org/wiki/HSL_and_HSV#Color_conversion_formulae), though, just a bit more complex than between RGB and YCbCr.

I'm not exactly sure how good results one would get by using Euclidean distance squared in HSL, compared to same in say YCbCr (which is even simpler to convert to/from RGB than HSL).
Title: Re: Colour Names in Austrian and English?!
Post by: Lord of nothing on December 06, 2020, 10:43:22 pm
In my case I want to read in maybe when I know more about Python the hole List from my IT Distributor and write my own little GUI for that Data with better search. The Colour could be in German (Austrian) and in English. Now I must search for both terms. Some Company think the must be fancy and not name for example an Ethernet Cable Blue the maybe call them "Sky" or a Network Rack is not Black nnoooo its Graphite.  :palm: 98% would call them Black but a Search for Black dont show anythink up. The same for light Colour there could be many ways to call something Gray.
I found a Cable who called "gruen" who is with a "ue" instead of a "ü" (who is correct) and mean green. The chance to find that with just typing the Colour Name is quite 0...  :=\
The same for the Network Cable the different type of Shield like FTP, UTP,...
Sometimes the use a "/" or a "-" and so on and on and on...
There are many thinks who I could do when I read a DB into "my" (upcoming) System and I must do some good scripting to "fix" the Data in the way to get an Output who I can use. Currently the Data are  :scared:...
Title: Re: Colour Names in Austrian and English?!
Post by: AntiProtonBoy on December 06, 2020, 11:14:45 pm
That won't differentiate "dark" and "light" variants of the same color, for example "brown" and "orange" (having the same hue coordinate).
You could extend the aforementioned hue check to include lightness as well. This all depends on the problem domain and what you're trying to solve in the end.

What OP is trying to solve seems like a colour quantisation problem, so I would probably try to use a different approach than simple colour comparison.

Title: Re: Colour Names in Austrian and English?!
Post by: Nominal Animal on December 06, 2020, 11:23:15 pm
In my case I want to read in (maybe when I know more about Python) the whole list from my IT Distributor and write my own little GUI for that Data with better search.
In that case, may I suggest that instead of mapping the color or surface material, you categorize it?

That is, you'd have a few, say a dozen or so, but not much more, basic categories like black, white, gray, red, green, blue, yellow, brown, purple, metallic, bright, dark, matte, gloss.  Instead of trying to fit the color/surface into one of these categories, just check all ones that do apply.  (It would be important to choose the categories well, to match the typical use cases.  For example, for cabling, I'd first do some research on which colors are commonly used.)

This way, if someone is looking for a specific color, they reduce the search set by limiting the view to those categories only.
You could add a word search/limit to the surface/color description, using the sort of "normalized" comparison I mentioned (simplifying the text to say latin alphabet in lower case for the comparison, with the normalization producing one or more possible variants – those can be precomputed in the database).

This will not give just the exact matches to the user, but the descriptions aren't exact either.  (We really don't know what "graphite" means, because graphite exists in both glossy and matte forms, for example.)  The idea of this categorization is to easily reduce the set of matches to a shorter list the human can check.

You could do what Randall Munroe did, and "outsource" this categorization work to other people, if it is too much for yourself.  Write a web interface where the data entries are only the descriptions, and one can either Skip, or tick the applicable category checkboxes and click Ok.  Have it provide a random un-categorized entry.  Put it behind a password, and hire someone to fill in the categories, or do it yourself when you're bored.
Title: Re: Colour Names in Austrian and English?!
Post by: AntiProtonBoy on December 06, 2020, 11:43:43 pm
Lord of nothing, here is what I would do:

1. First, I would research and collect as much colour names and their associated RGB values as possible. Below is a few resources to start off with. I'd also get colour names from paint manufacturers, like Dulux, etc. Make-up and fashion catalogues are also a great source of colour names.

https://simple.wikipedia.org/wiki/List_of_colors (https://simple.wikipedia.org/wiki/List_of_colors)
https://simple.wikipedia.org/wiki/Web_color (https://simple.wikipedia.org/wiki/Web_color)
https://www.eggradients.com/color-names (https://www.eggradients.com/color-names)
https://www.ncl.ucar.edu/Applications/Scripts/rgb.txt (https://www.ncl.ucar.edu/Applications/Scripts/rgb.txt)
https://www.ncl.ucar.edu/Document/Graphics/named_colors.shtml (https://www.ncl.ucar.edu/Document/Graphics/named_colors.shtml)

2. Tabulate those colour names and their RGB values in a database. Translate those colours names from english to german as required. Google translate will cover most cases, but you'll have to manually check to make sure the translation actually make sense. Quite doable for ~1000 colours, and you only have to do it once.

3. Choose a bunch of "main" colours you want as a primary classification for tagging your products. That is, the "main" colours you'll associate with each product meta-data, and you'll use to check during search.

4. Now it's time to implement your colour matching/classification algorithm: The idea is to classify all the colour names in the database to the chosen "main" colours you picked in the earlier step. This is a well researched problem and is often seen in image processing, where true colour images are converted to paletted images. The process is often called Color Reduction or Image Quantisation. There are a few classification algorithms out there, such as Median Cut, Optimised Octree Quantization, and Vector Quantisation. The Vector Quantisation method gives you probably the best results. Whatever method you choose, you can tag each named colour in the database with the classified "main" colour.

5. As for handling the usage of umlauts, you can easily run a separate spell checker filter on the input. In fact, I would constrain colour input names to whatever names you have in the database by giving users real-time suggestions or hints has they type. The best way to sanitise inputs is to constrain users to sensible values from the very onset.
Title: Re: Colour Names in Austrian and English?!
Post by: Lord of nothing on December 07, 2020, 12:22:05 am
1) I must "convert" a colour "name" into a Value who is the same in all languages.
2) When I have the Value I could put them into a Group like here: https://en.wikipedia.org/wiki/Web_colors#Extended_colors
Title: Re: Colour Names in Austrian and English?!
Post by: AntiProtonBoy on December 07, 2020, 02:37:56 am
Yes? Steps above does just that?
Title: Re: Colour Names in Austrian and English?!
Post by: golden_labels on December 07, 2020, 04:01:50 pm
1) I must "convert" a colour "name" into a Value who is the same in all languages.
What I have provided above does exactly that. And more.

2) When I have the Value I could put them into a Group like here: https://en.wikipedia.org/wiki/Web_colors#Extended_colors
Create another table which maps colors to groups?

Theoretically you could divide the color space into convex subspaces with assigned group names and then find in which one a color lies. But that is unneccessarily complex. You would probably have to enter more coördinates into that structure than the number of colors you want to use ;). Semiautomatic classification like that may be tricky in some cases too. A simple mapping will do.
Title: Re: Colour Names in Austrian and English?!
Post by: semonbright on May 30, 2022, 04:58:57 am
Here is a cool little tool if you want to create your own and don't know the code.....color code (http://net-informations.com/q/web/color-codes.html)
Title: Re: Colour Names in Austrian and English?!
Post by: golden_labels on May 30, 2022, 02:40:31 pm
semonbright:
Can you explain, how is that relevant to OP’s question?
Title: Re: Colour Names in Austrian and English?!
Post by: gf on June 02, 2022, 07:24:13 am
The major problem I see is that there exists no single, unique standard for color names.
There exist a couple of commonly used color naming schemes like e.g. X11, HTML, CSS, SVG colors in the IT world, or RAL or Pantone for surface colors and/or graphic arts.
Still many manufacturer of "colored objects" feel free to invent their own fancy color names.
Title: Re: Colour Names in Austrian and English?!
Post by: DavidAlfa on June 02, 2022, 09:57:28 am
As if there weren't enough standards already, yep, lots of stuff use their own language-localized color codes
I discovered this long time ago when modifying the car to install a reverse camera...My car uses italian color codes! It's an Alfa Romeo, at least they're using schematics and codes :-DD
Jokes apart, it's starting to show the age after 16 years, 600K km and bash driving .
I would have scrapped it if using german codes.... get ze flammenwerfer!
Title: Re: Colour Names in Austrian and English?!
Post by: golden_labels on June 02, 2022, 06:54:05 pm
The problem? Do you think it would be better if a person, wanting to communicate a color name, would use its internationally standardized name? Because that seem to be what OP asked about. So, let’s sing with me: “Lady in #BC1615 is dancing with me”.

Title: Re: Colour Names in Austrian and English?!
Post by: SiliconWizard on June 02, 2022, 07:01:03 pm
If you want a standard way of naming colors, use Pantone. Done.
http://www.pantone-colours.com/ (http://www.pantone-colours.com/)
Title: Re: Colour Names in Austrian and English?!
Post by: gf on June 02, 2022, 09:03:00 pm
The problem? Do you think it would be better if a person, wanting to communicate a color name, would use its internationally standardized name? Because that seem to be what OP asked about. So, let’s sing with me: “Lady in #BC1615 is dancing with me”.

Well, look how many names (from various vendors) are close to #BC1615 (https://encycolorpedia.de/bc1615). And I don't think this list is exhaustive.
Not sure if "Lady in E 07-40X" or "Lady in Newcastle / LP-138" is really better than "Lady in #BC1615"?

If you want a standard way of naming colors, use Pantone. Done.
http://www.pantone-colours.com/ (http://www.pantone-colours.com/)

Pantone and RAL colors are quite common, but both are still private companies who have defined color palettes.
I'm not aware that either of them were an official international standard. I'm also unsure whether their color palettes and names are royalty-free.
Title: Re: Colour Names in Austrian and English?!
Post by: golden_labels on June 02, 2022, 11:27:02 pm
That was a sarcasm…