|
|
#1 |
|
Color naming by value
Hey
I was wondering, is it posible to give the color a name, when you got the hex value of the color. So if you would have #FFFFFF it would say "White", some apps have this, are they having some sort of algoritme or an pre defined color table with the value's and names in it ? Grz |
|
|
|
0
|
|
|
#2 |
|
Here is the standard web safe html hex colors with names.
Link: http://www.w3schools.com/html/html_colornames.asp
__________________
2.4 MacBook Aluminum 480GB SSD/750GB Optibay 8GB RAM CE | MacBook 2.4 SR 4GB, 320GB HD | PB G4 1.67 | 15 TiBook-DVI 800 iPhone 4S 16GB | iPhone 5 32GB
|
|
|
|
0
|
|
|
#3 | |
|
Quote:
|
||
|
|
0
|
|
|
#4 |
|
All you do to go from 255, 127, 80 to FF7F50 is replace each of the 3 components with hexadecimal and remove the spaces and/or punctuation between them. To go the other way, break up each pair of characters and then convert from hexadecimal to decimal. Is that the answer to your question?
|
|
|
|
0
|
|
|
#5 | |
|
Quote:
|
||
|
|
0
|
|
|
#6 |
|
So, you want a method where you pass it an RGB value in hex and it returns a name, in a string presumably? Note that many RGB values don't have a HTML color name equivalent and UIColor is even more restrictive. And what would you use this 'name' for?
__________________
|
|
|
|
0
|
|
|
#7 |
|
|
0
|
|
|
#8 | |
|
Quote:
And I will use this for myself and other's that are colorblind for choosing the "right" (It's never 100% acurate but it does it) colors. |
||
|
|
0
|
|
|
#9 | ||
|
Quote:
Quote:
__________________
|
|||
|
|
0
|
|
|
#10 | |
|
Quote:
Take photo, select pixel of the t-shirt. en compare it to the closest HTML color name (http://www.w3schools.com/html/html_colornames.asp) |
||
|
|
0
|
|
|
#11 |
|
Well, I don't think there's an algorithm for this, so you'll probably need a lookup table of some kind.
__________________
|
|
|
|
0
|
|
|
#12 |
|
I agree: you will have to have a lookup of values and an algorithm to decide which is "closest". I would note that the simplistic option of calculating absolute difference of the 3 components and adding them together then selecting the smallest difference may not result in the answer you would expect: visual difference of colours is a complex task and not an easy one to automate...
__________________
Sponsor me to cycle 100Km round London in the dark |
|
|
|
0
|
|
|
#13 |
|
Some pixels from the camera are dud, and don't agree with the
pixels adjacent to it sometimes, even if the whole scene is close to one colour. You need to look at the value of five or so pixels and calculate their mean average. --- Put all of the hex values from the link you provided in a lookup table, and all of their English names in another array in the same order. Create an empty integer array with the same number of elements as there are colours in the table. Get the mean average of a few pixels from the camera, that's the input colour. Calculate the total deviation of all three colour components of the first colour value in the lookup table, and store the total deviation across all three colour components in the first index of the integer array. Do this for the entire colour table. Find the integer array element with the lowest value. The colour name in English that has the same index is the closest colour with a name in English. Bear in mind the end of the answer above. The solution is rough. Last edited by xArtx; Feb 4, 2013 at 06:04 PM. |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 12:39 PM.








I support the
Linear Mode
