Colour Name to RGB/Hex/HSL/HSV etc - colors

I have come across this great function/command. Colour to RGB, you can do this:
col2rgb("peachpuff")
//returns hex
It will return one hex value. I want to extend this using Perl, Python or PHP but I want to be able to pass in, for example, "yellow" and the function returns all types of yellows - their hex/rgb/?/etc value.
I already have a quick solution implemented, which involves mapping colour names to hex values but now I want to get more precise and use some formulas etc to determine what's what.
However, as usual, I don't have a clue on how to do this! So I appreciate any implementation advice on how to do this.
Thanks all

The canonical CSS color names originated in X11 and the intersection of the sets - along with their RGB values can be - found at Wikipedia.
A more easily parsed list can be found in various rgb.txt files scattered over the web, but these are likely the X11 set not the CSS set.
added: Given an RGB value you can compute nearby colors by HSL conversion. Color palettes - sets of colors that go well together - are an art not a science, Google 'em.

Why don't you use the ccs Color names.
W3c webstandard --> CSS3/SVG Farben

Related

How do I tint an svg in processing and preserve brightness?

I've been trying to figure this out for 2 days now, so I hope somebody can help.
I need to load in svg files that have multiple values of gray within them and tint them with colors. So for example, say the svg file is an image of a rock and has 4 values of gray. I need to be able to display the rock as red and keep the differences between values in the different child shapes. In other words, I would like it to work just like PImage.tint().
I see there are tint() and setTint() methods to PShape but I can't seem to get them to work. I also though about recursing through the child shapes and reading each color individually and recoloring appropriately, but I couldn't even figure out how to read the color out in a way I understand.
Help, anyone?
If you have it as an <img> you can use the CSS filter property with hue-rotate https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/hue-rotate
Or you add the svg directly to the html and add classes to your elements. Then you could change the colors in your script.
If this is a flat colour then you could use the alpha value in RGB colour value. See 'color transparency' in the following link: https://processing.org/tutorials/color/
The fill value is fill(red, green, blue, transparency)
I hope this helps. If you want to share code and have a reason for using PImage I'd be happy to have a look.

Changing colors in a simple shape editior

I've made a simple shape editor. I can change colors (used to fill shapes) by click on buttons in a menu bar. The disadvangate of this solving is the fact that the numbers of colors are so restricted. I can't find a better solution for my program. Can somebody help me and give me an idea how can I improve it? I thought about color palette, but I have no idea how can I do this.
The image:
("Aktywny kolor" means active colors, and there is the list of colors below, which I can use)
You would need to use a color picker where the colors are distributed on many pixels and not on a very small set of color names. Since you are using applet, you might want to download an already made color picker compatible with your environment, or you might want to write your own, depending on whether the things you find meet your expectations.

How to get matching colors (red and green) for a given color code (blue)

I am new to CSS and programming in general so I am sorry if this is a beginner question but I couldn't find a proper solution myself.
If I have a certain color code (HEX), e.g. #028dca, how can I get matching colors for this ?
I found a number of tools online but I only saw solutions that give me different shades of the same color whereas I need different colors that match the above hue etc., especially red and green - and a few more colors would be nice to have.
One of several examples I tested is the following but again I couldn't find a proper red and green tone there, just different shades of blue and orange as the complementary color (and it looked similar with other tools I checked): https://color.adobe.com
Can someone help me with this ?
Many thanks in advance,
Mike
Don't know actually what you mean with "couldn't find a proper red and green tone". Given a particular color, it has complementary colors... it's math.
Here is the one that I use: http://croma.numixproject.org
Try using Coolors.co
You can fix on colors and then try different palettes.
The one with the color you posted would be like this - http://coolors.co/app/86615c-f1a699-028dca-79065a-02241a.
You can explore more by hitting the spacebar

Specifying alternate glyphs for potentially unrepresented unicode code point

Unicode has a lot of fancy code points that can be used to do things like change the direction text is formatted, include inband protocol information and other things.
I want to find out if there is a way of specifying, as part of a unicode string, a 'fallback' glyph or set of glyphs where an uncommon unicode code point is unrepresented in the font being used to display the text?
Example:
"æ<character to signify use following as alternate if previous character unavailable>ae<character to specify end of alternate>"
I've had a look through some of these code points at unicode.org and tried some different searches on SO without success. Some of the topics I've looked at:
Is there a way to programatically determine if a font file has a specific Unicode Glyph? (Windows/C#)
How to map code points to unicode characters depending on the font used? (Java)

Custom FeedCount. Acording to which rule FeedBurner converts colors?

I am traying to prepare own dynamicly generated FeedCount for my own subscription service. I think this will be a good idea to support convention for setting colors via URL which is well known from FeedBurner,
http://feeds.feedburner.com/~fc/Ekundelekpl?bg=99CCFF&fg=000000&anim=0
this URLs produce such image.
fg is means a text color, bg means here a dark blue color. However light blue (ccffff) is here generated according to some rule.
Is this a some kind popular convert color convention, which is well known in webdeveloper/designers world?
I checked few other pairs of color, but I count figure out what the rule is. I don't want to hardcode all colors supported by FeedBurner.
[EDIT]
There is 216 available colors. Here is twelve pairs which I have extracted:
000000,7e7e7e
000033,8a8a8a
000066,909090
000099,9999CC
0000CC,9999FF
0000FF,9999FF
006600,909090
006633,99CC99
006666,A2A2A2
006699,99CCCC
0066CC,99CCFF
0066FF,99CCFF
I did it in another way.
I decided to use feedburner as template. I download proper image and override parts which interest me.
https://github.com/noisy/eGazeciarzFeedCount

Resources