Color model name - css

I'm learning bootstrap from twitter, I want to do some color changes, and I got this color code: #08c
I want to know if it represent #0088cc (and same way for other variations?)
and how is it called so I can find some online color palette.
I thank your help in advance

Yes #08c is equivalent to #0088cc.
Not all colors have names. This one in particular does not.
For a list of all named colors defined in css3 see the spec
From the spec
The format of an RGB value in hexadecimal notation is a ‘#’
immediately followed by either three or six hexadecimal characters.
The three-digit RGB notation (#rgb) is converted into six-digit form
(#rrggbb) by replicating digits, not by adding zeros. For example,
#fb0 expands to #ffbb00. This ensures that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies
on the color depth of the display.

I use this site
http://www.2createawebsite.com/build/hex-colors.html
to generate color codes for my colors. #08c is not a full representation but it could mean #00008c.

Related

Plotly - I want to color the Y axis tick text based on value

My questions is similar to one that's been asked but in a different language. I'm using plotly in python, to build dash web app dashboards and I have graphs with a y-axis range from negative values to positive values. I would like to leave the positive values black, but I would like to change the negative values to be red (preferably with parentheses around them as well, but the red color is the more important item).
From my research, it seems that there is no native way to do this. I'm up for a complicated solution if that's what it takes. When I inspect the element in the web interface, I can see the html code that shows the RGB values for the text of each tick, but I cannot seem to figure out where I can modify the colors independently of the other tick texts. I've started looking for the source file that is used to format these things so that I can potentially add the logic to it.
The similar question is here and it was asked for JavaScript: Plotly - I want to color each X Axis value in different color based on condition
Any help is appreciated.

Convert RGB colors to DMC floss colors

I'm trying to find an automated way to calculate what DMC color is closest to a given RGB. I found this site:
http://www.damaniel.info/dmc/dmctorgb.html
And that does what I want. However, I have to type each RGB is separately and I have a lot of them.
I'd like to use formulas to automate the calculate. Preferably in Excel or in R. I haven't had luck with Selenium (and don't have much spare time right now to get up to speed), so that might not be the best option for doing automated form filling with the above site.
Any ideas?
The DMC R package (1) will help with that. It looks like it only supports hexadecimal codes, but you can convert RGB colors using the rgb function from the grDevices package (Use maxColorValue = 255 if you are using RGB versus rgb).
# install.packages("devtools")
# devtools::install_github("sharlagelfand/dmc")
library(dmc)
# convert rbg to hex
# second green color from ColorBrewer.org
# (3-class BuGn second color)
color <- grDevices::rgb(red = 153, green = 216, blue = 201, maxColorValue = 255)
# find dmc - return a few more results
color_dmc <- dmc(color, n = 3)
color_dmc
If you have a few colors, you can wrap this in a loop or apply function and write the dmc values to a master object by extracting the elements you need (i.e., color_dmc$hex, color_dmc$name, etc.)
1 https://github.com/sharlagelfand/dmc
There's a list of RGB values corresponding to DMC floss colors here: http://my.crazyartzone.com/dmc.asp . There's also a list built in to the source code for the web page you found (and it's different). You can see that list at this URL: http://www.damaniel.info/dmc/dmctorgb.js .
Why are they different? There are different standards for RGB. The most common one is now called sRGB (for "Standard RGB"). They might be using different standards. Or maybe they are getting their colors from different sources. They are approximate, anyway: floss varies in color. So just pick one.
Then what you would need to do is to take your RGB value and find the nearest value in one of those lists.
This isn't trivial, because defining "nearest" is hard. What that web page appears to do is to use Euclidean distance in RGB space, but that space is far from perceptually uniform. So it's probably best to convert both your input RGB color and the table of floss colors to some other representation where equal distances are perceptually equal. I think the LAB space (see ?colorspace::LAB) is probably a good choice for that, but I don't know if it's best. Read http://colorspace.r-forge.r-project.org/articles/color_spaces.html if you want to dig into the details.
So here's what you need to do:
Load a version of one of those tables into a dataframe.
Convert all the RGB values there into LAB values, and add those to the dataframe.
Write a function to convert your input RGB value to LAB.
Find the nearest LAB entry in the dataframe to the LAB value you want, and output the corresponding floss number.
EDITED TO ADD: While I was writing that, #dcruvolo pointed out the nice dmc package. So use that! (Maybe you want to change how it does distance; you really don't want the default Euclidean distance in RGB space.)

Hex to color name

I want to tag color names based on hex or rgb values. I found this amazing site ( http://www.color-blindness.com/color-name-hue/ ) but the thing is there are so many color names and main color hues are insufficient. I would love to have a solution to name RGB or HEX for like 40-50 well known colors.
Any idea will help me, thank you
This one will be useful, you will have to parse this json to use it in your project.
I wrote a command-line tool that does exactly that: Cict
Example:
$ ./cict 000081
1 #000080 navyblue
As you can see, you simple pass a 24-bit hex-value to cict and it reports the distance to the color found (1 in this case), the value of the actual color (#000080) and the name (navyblue).

What are the color names available for scale_color_manual?

This page shows how to use scale_color_manual in R. It gives red, green, and blue as possible color values.
What values are available?
How do I see what values are available? (Say I've loaded or made a new palette.)
Nothing is special about the color names available in ggplot - they are the same as the color names available in R. You can use colors() to see the the list, with details at ?colors. I generally prefer to search the web for "R colors" because your first hit will almost certainly be a document that shows the colors with the color names.
Say I've loaded or made a new palette.
A palette is an object that contains colors. It can contain named or un-named colors. Palettes do not change the named colors that are available.

Are there any performance differences between color names or hexa values in css?

Color properties in CSS can accept color names ( white, pink, etc) or hexadecimal values ( #FFF , #669966 , etc) or RGB.
But not all the color names are standard for all browsers. There are tests like CSS color names vs hex codes, (my results is better hexadecimal) , so is it always better to use hexadecimal than other two options?
Edit: Other duplicate questions is about personal preferences, this is about performance.
Putting away the color names, the hex values and RGB are pretty much the same.
But the result shows that Hex codes are slightly faster (not that much to worry about).
For example, Firefox 11 does 15,400 operations of hex code but 14,900 of rgb in a second.
So, that is not much to worry about. You won't even notice that.
You have sort of already answered your own question... "Not all color names are standard." It is best to get used to use the 6 character hex codes for color. It is explicit and there is no confusion. I have seen some versions of IE mess up with 3 digit hex codes also.
Hex codes are also better because there are many tools like Classic Color Meter, etc which will tell you the hex color value of something your mouse is rolling over.

Resources