Full Color Palette?

Full Color Palette? - Messages

#1 Posted: 10/11/2010 1:16:48 PM
Oscar Campo

Oscar Campo

124 likes in 298 posts.

Group: Moderator

Hi,
I would know the names of available colors for use in 2D canvas text. I was trying with the following:

"Red", "Orange", "Yellow", "Lime", "green", "Turquoise", "Cyan", "blue", "violet", "purple", "magenta", "lime", "brown", "pink", "indigo", "grey", "black", "white", and combinations as "light yellow", "dark violet", "pale green" and so on.

Please, would you post a complete list of colors?

It´s possible to define colors in RGB format?

Thanks in advance,

Oscar
#2 Posted: 10/11/2010 1:51:20 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

I agree,

The complete list of colors for the 2D canvas would be welecome. Morover, I wonder if there might be a way to use integer numbers as alias in addition instead of color names.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 10/11/2010 2:17:38 PM
Andrey Ivashov

Andrey Ivashov

2269 likes in 3730 posts.

Group: Super Administrator

Hello.

Here is a complete list of possible colors (spaces and upper case letters are not matter):
aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, "blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, green, greenyellow, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgreen, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, red, rosybrown, royalblue, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen, black

FYI: You can use darkblue, DarkBlue, Dark Blue (recommended), DARKBLUE, D a R k B l U e ant etc. - all spaces will be removed and color name will be converted to lower case chars.

You can use number instead of color name as well. Number composing rule is a bit complex, but it is similar with web-colors: color represented as a hexadecimal number where first pair is a Red Component, second pair is a Green Component and third pair is a Blue Component. For example 00FF00 is a Green color, CCCCCC - something Gray and etc. When you have a hexadecimal number you need to convert it to decimal number to use it in SMath Studio (f.e. Green = 00FF00 = 65280).

Best regards.
#4 Posted: 10/11/2010 3:03:11 PM
Oscar Campo

Oscar Campo

124 likes in 298 posts.

Group: Moderator

Thank you so much.
Only a little question: I was trying with numbres instead color names, but no result. I tryed the following:
#5 Posted: 10/11/2010 8:53:08 PM
Andrey Ivashov

Andrey Ivashov

2269 likes in 3730 posts.

Group: Super Administrator

Ah, yes... I forgot about opacity First component should be opacity and the next ones are as described above, so Green is equal to FF00FF00. But the logic now becomes more complex. Because of the maximum 32-bit integer is 2147483647 (0xFFFFFFFF/2) and FF00FF00 = 4278255360 (i.e. greater then the max. integer), then Green is FF00FF00-0xFFFFFFFF-1=-16711936. Hope I've described it...



Yeah, I know, this is interesting task for user to generate such color number

Regards.
#6 Posted: 10/12/2010 2:30:05 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello,

Quite a complicated numbering color scheme. I will certainly give up using those numbers.
As I could see there is about 140 colors in the color list (if I count them well). I thought if there might be a way in SMath to internally have integers from 1 to 140 representing those colors and to put, say, 2 instead of "antiquewhite". But it seems it is not going to work because the fifth column of the plot matrix expects the number based on the above defined numbering color scheme.
Never mind, I think we will stick with the color list

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#7 Posted: 10/12/2010 9:35:59 AM
Andrey Ivashov

Andrey Ivashov

2269 likes in 3730 posts.

Group: Super Administrator

To help with these numbers I've created a snippet webColors.sm (put it to the snippet folder of SMath Studio installation directory) with "colors" shortcut.



Note, that you're able to set any possible opacity for the color or not to specify it at all (in that case color will be non-transparent). See screenshot above for example.

Regards.
1 users liked this post
Radovan Omorjan 10/12/2010 9:56:00 AM
#8 Posted: 10/12/2010 12:58:59 PM
Oscar Campo

Oscar Campo

124 likes in 298 posts.

Group: Moderator

Thank you so much Andrey, I was working in this idea, so here is my version (using some lines of your code ):



Snippet: RGBcolor.sm

Regards,
Oscar
2 users liked this post
Andrey Ivashov 10/12/2010 1:14:00 PM, Radovan Omorjan 10/12/2010 2:19:00 PM
#9 Posted: 4/28/2012 9:57:52 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

Thank you so much Andrey, I was working in this idea, so here is my version (using some lines of your code ):

[...]

Snippet: RGBcolor.sm

Regards,
Oscar


Hi,

I used your snippet to develop one that behaves similarly to the functions rgb and rgba used for websites (CSS3 behavior compatible)



r,g,b must have values from 0 to 255; alpha value must be from 0.0 to 1.0.

Decimal numbers in r,g,b does not cause the blocking of the function, like negative values or values greater than 255 (or 1.0).


here is the snippet: RGB-RGBA colors.zip

here is the *.sm example shown in the figure: RGB-RGBA test.zip


regards,

w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 users liked this post
Oscar Campo 4/30/2012 8:00:00 AM, Mark R Harris 11/18/2022 5:09:00 AM
#10 Posted: 5/23/2022 12:53:25 PM
banxyrock35

banxyrock35

0 likes in 1 posts.

Group: User

Wrote

Hello.

Here is a complete list of possible colors (spaces and upper case letters are not matter):

aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, "blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, green, greenyellow, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgreen, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, red, rosybrown, royalblue, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen, black

FYI: You can use darkblue, DarkBlue, Dark Blue (recommended), DARKBLUE, D a R k B l U e ant etc. - all spaces will be removed and color name will be converted to lower case chars.

You can use number instead of color name as well. Number composing rule is a bit complex, but it is similar with web-colors: color represented as a hexadecimal number where first pair is a Red Component, second pair is a Green Component and third pair is a Blue Component. For example 00FF00 is a Green color, CCCCCC - something Gray and etc. When you have a hexadecimal number you need to convert it to decimal number to use it in SMath Studio (f.e. Green = 00FF00 = 65280). You can also try to go here https://create.vista.com/colors/palettes/galaxy-color-palette/ and choose the right palette of colors for yourself, and there each color clearly has its correct name, and pull them out there for yourself, I think this can help.

Best regards.


Thank you very much for your advice, I think that this can help me too, it's cool that there is such a site with color palettes, it really simplifies life.
#11 Posted: 11/18/2022 5:12:57 AM
Mark R Harris

Mark R Harris

4 likes in 90 posts.

Group: User

Thanks so much Davide.
Is it possible to pass the four values to the rgba(r, g, b, a) function as variables? I'm currently having the problem that after the function is called the variables have become strings "ff" style.

Wrote

Wrote

Thank you so much Andrey, I was working in this idea, so here is my version (using some lines of your code ):

[...]

...r,g,b must have values from 0 to 255; alpha value must be from 0.0 to 1.0.

Decimal numbers in r,g,b does not cause the blocking of the function, like negative values or values greater than 255 (or 1.0).

...
w3b5urf3r

#12 Posted: 11/19/2022 4:18:23 PM
Mark R Harris

Mark R Harris

4 likes in 90 posts.

Group: User

Thank you for the reply Jean.

Unfortunately, and as usual, it wasn't on-topic (Full Color Palette: specific question regarding parameters being handled with variables). This renders the extra content (kindly, but incorrectly provided) as SPAM that detracts from the value of the forum.

Jean, in the future please please review your responses to check they are on-topic (ie not SPAM) before hitting the 'POST' button.

Wrote

Wrote

Is it possible to pass the four values to the rgba(r, g, b, a) function as variables? I'm currently having the problem that after the function is called the variables have become strings "ff" style.


Image region is universal of 3 arguments.
There are other ways to set/adjust region of whatever ...
luminosity, opacity, transparency, transluslency ...



1 users liked this post
churichuro 11/19/2022 7:38:00 PM
#13 Posted: 11/19/2022 6:37:15 PM
overlord

overlord

551 likes in 1332 posts.

Group: Moderator

I do report every post of him if it is not-related with topic.
I suggested you to do same, it is only counter-measure we can take.
2 users liked this post
churichuro 11/19/2022 7:40:00 PM, Mark R Harris 11/19/2022 10:48:00 PM
#14 Posted: 11/19/2022 7:39:45 PM
churichuro

churichuro

28 likes in 79 posts.

Group: User

Jean, in the future please please review your responses to check they are on-topic (ie not SPAM) before hitting the 'POST' button.
#15 Posted: 11/19/2022 10:56:12 PM
Mark R Harris

Mark R Harris

4 likes in 90 posts.

Group: User

OK, one more try:

I wish to declare a color as green50 which is rgb green with 50% opacity.

green50:=(0,255,0,0.5)

and then use it (ie pass green50 as a variable) with Davide's rgba snippet:

rgba:=(green50)

Thanks in advance.
#16 Posted: 11/20/2022 8:27:40 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

OK, one more try:

I wish to declare a color as green50 which is rgb green with 50% opacity.

green50:=(0,255,0,0.5)

and then use it (ie pass green50 as a variable) with Davide's rgba snippet:

rgba:=(green50)

Thanks in advance.



If you just want to store the input to rgba() in a separate variable and apply it later, then you might use the at() substitution function. Yet it is not clear to me, why one would do that instead of just storing the resulting color string from rgba()

Blatt5.png
Blatt5.sm (3 KiB) downloaded 34 time(s).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Mark R Harris 11/20/2022 3:26:00 PM
#17 Posted: 11/20/2022 3:26:54 PM
Mark R Harris

Mark R Harris

4 likes in 90 posts.

Group: User

Thank you Martin, excellent.
#18 Posted: 12/23/2022 1:50:27 PM
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

74 likes in 164 posts.

Group: User

Greetings,

If you are reviewing this thread, you may notice some broken links, such as the following two files:

Wrote

...
here is the snippet: RGB-RGBA colors.zip

here is the *.sm example shown in the figure: RGB-RGBA test.zip
...



Please note, these urls have evolved from http to https, thus the updated links to download those files are as follows:
- https://smath.com/wiki/GetFile.aspx?File=graphs%2fRGB-RGBA%20colors.zip
- https://smath.info/wiki/GetFile.aspx?File=graphs%2fRGB-RGBA%20test.zip

On that note, most of the contents contained within this thread have been summarized on the following WIKI:
- https://smath.com/wiki/Graphs.ashx


Hope this if of Good Help, and Merry Christmas!
- Kenny Lemens, P.E. ᵂᴵ
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
2 users liked this post
Mark R Harris 12/23/2022 8:16:00 PM, Alvaro Diaz Falconi 12/24/2022 2:41:00 PM
#19 Posted: 12/30/2022 4:51:38 AM
sanitaro25

sanitaro25

0 likes in 1 posts.

Group: User

useful information
  • New Posts New Posts
  • No New Posts No New Posts