-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
New color names source #2
Comments
Hi meodai, thanks for the link! Your project is really good and I shall look into integrating it into my NTC project. I'll try to find a way to automate updating the colors list so that the NTC app can be programmatically updated from time to time. But right now, the NTC app needs to be first update to work with the latest PureBasic version, for the language has undergone some breaking changes since its release (although I could just keep using the old version of the language). I always wanted to manage color lists myself, and indeed did some research and gathered various lists from around the web, but then I never found the time to build a tool that could manage them and merge all the colors in a unified list without duplicate color entries, and some criteria to decide which color name to keep in case of duplicate entries. So, it look like you project is the answer for my procrastined intention to do something similar. ;-) Since I've myself gathered numerous lists which are sitting in my harddrive, I'll see if I can contribute them to your project. |
Added new milestone: https://github.com/tajmone/name-that-color/milestone/1 |
I would love your contribution then. I built a few node tools to help me to keep the list clean and I mostly administer the list in google docs. I would love to give you access to the document. Let me know If I can add a web-hook somewhere so you would always get the most up to date list; I deploy the server on heroku anyway: https://api.color.pizza/v1/212121,212121?noduplicates=true |
I'd love to and I will, but I'll need some time before I can commit myself to it because right now I'm juggling too many projects with loose ends which I need to update. Once the workload cools down I'll definitely allocate some time slots to help you with the project because I really think it's an important contribution to world of designers in general.
May I ask you which criteria you use to handle duplicates? I had original thought of giving to the various sources some priority weights to handle duplicates, and also use a rule system of some sort — where failed attempts to merge the lists due to duplicate entries would ask the user to make a choice and store the answer as a new rule. My original idea was to keep at all times all the color names source lists, and remerge them every time new entries were added. This was thought in order to preserve references from where the color names were taken from. I had though that some lists have an overall higher value than others (e.g. the classic crayon colors, being wellknown) while other lists might have an intrinsically lower priority (e.g. the special crayons names, which are mostly metallic colors or other special colors which can't be represented on screen). Of course, in case of duplicate entries it could also be possible to store multiple references, and then leave it to the single use-case-secnario wether to stop at the first result or use them all. Anyhow, it seemed to me that managing all the colors lists does require some method of sorts for duplicates are likely to show up quite often, and different usage might ask for different ways to manage/reduce the entries.
Thanks, I will. Just allow me some time to close a couple of pending projects and reorganize my time schedule (I'll need to allocate some fixed time slots to this new project, for I can see it's going to be a long-term commitment). Also, I've gathered a lot of materials and notes during my previous work; hopefully I'll be able to extract some useful assets from them. If I remember correctly, I had already started transforming many loosely formatted color lists into JSON. But because a length of time has passed in the meatime, I'll need some time to catch up with were I had left. |
No worries there is now rush. My ruleset is pretty simple and not as elaborate as what you are thinking of (https://github.com/meodai/color-names/blob/master/scripts/build.js) Basically only checking if a hex value or name already exists and just fail the build. The merging is done by hand and we decide on a color by color base, what names sounds better. When both do, we just shift the hex color a little bit, but keep the name. I guess this could be automated, but I think the quality of the list would suffer. We got tons of "Hint of bla" or "dark bla" names that don't even make sense from different paint brand lists, that we are now renaming (or remapping to lists we have not merged yet) in order to sound nicer. The aim is not only to have a large list, but also one full of names that sound nice or at least not wrong or include stuff like |
You could make the program remember your choices so that when run again it can solve the same conflicts based on your previous choices. The benefits would be that you'd be keeping a history record of all your manual choices and could always undo some of them in case new entries would require better/different coiches. This is more or less the original idea I had in mind. Basically, you keep replaying the same choices over each lists merging process, and rules are built up stocastically from manual choices, but the whole system can be rewond and edited at any time.
Makes sense. |
Windows 7 x64 user here. I'm looking for a way to specify color in HEX and get the closest HTML color name. Consider adding that as an option, @tajmone, please. |
The simplest way to achieve this would be to tweak the source code and replacing the current colors list with a list containing only the HTML colors subset — but you'd have to use the exact same version of PureBasic indicated in the project.
I'm afraid the code is too old and the PureBasic language has undergone too many breaking changes and MAJOR version bumps since. Any tweaks to the code would entail a major refactoring of the codebase — a task which I'm unwilling to take and currently have no time for, unfortunately. PureBasic users have access to all previous releases of the language, so you could still do it provided you install the exact PB version used in the project. Alternatively, you could consider looking into the original JavaScript code which inspired this project (although it uses a different, less precise, color proximity algorithm) or other implementations of the delta-E algorithm in scripted languages. |
@sergeevabc in the mean time feel free to use: https://colornamer.robertcooper.me/ (choose HTML colors in the list on the bottom) or if you have windows curl installed you can hit up the API directly: https://api.color.pizza/v1/?values=ff0000&list=html |
David, thank you for your attention to my question and trying to find an alternative solution. Indeed, in my search for a console app, I had to settle on a web app. Of all the options offered, I chose https://wismuth.com/webcolors.html by François Labelle. The reason is the use of a more sophisticated algorithm for finding colors (I suspect it is the Delta E 2000) that outputs several options at once. Also, I liked Known Colors Palette Tool by @gggustafson. |
That seems a very nice app, and has the advantage that doesn't use a proprietary/commercial language (unlike PureBasic). From what I gather, it's written in C#, so you shouldn't have any problems building it yourself with free/FOSS tools, in case you need to tweak its behavior slightly. |
@sergeevabc https://api.color.pizza/v1/?values=ff0000&list=html does use DeltaE. (Ciede2000): https://github.com/meodai/color-name-api/blob/main/src/closestColor.js#L17. I can write a simple console app as a wrapper for you. That would be it for # Function to retrieve color name from the API
function NameColor {
param(
[string]$hexColor,
[string]$listType
)
# Make API call
$response = Invoke-RestMethod -Uri "https://api.color.pizza/v1/?values=$hexColor&list=$listType"
# Extract color name from the response
$colorName = $response.colors[0].name
# Print the color name
Write-Host "Color name for $hexColor is: $colorName"
}
you would have to save it as something called PS: if you add it to your powershell |
@tajmone, thank you, I've already looked at this solution using curl. Its drawback is that only one color is returned, so I settled on https://wismuth.com/webcolors.html In particular, I was looking for a color with a name close to #e2d0b9, but not so dim. In both cases the algorithm suggests Bisque color, but, as it turned out, it is too saturated, whereas the second color, AntiqueWhite, is the one that pleases the eye. |
@sergeevabc you can make the API return as many closest colors as you want. Just add the https://api.color.pizza/v1/?values=ff0000,ff0000,ff0000,ff0000&list=html&noduplicates=true in fact thats how this is done: https://codepen.io/meodai/full/PoaRgLm |
Hey! Great project.
I am maintaining this: https://github.com/meodai/color-names
Feel free to pull the names from there, since most sources you are using are also included and actively maintained
The text was updated successfully, but these errors were encountered: