Full Color Palette?

Full Color Palette? - Сообщения

#1 Опубликовано: 11.10.2010 13:16:48
Oscar Campo

Oscar Campo

124 сообщений из 298 понравились пользователям.

Группа: 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 Опубликовано: 11.10.2010 13:51:20
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: 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 Опубликовано: 11.10.2010 14:17:38
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3730 понравились пользователям.

Группа: 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 Опубликовано: 11.10.2010 15:03:11
Oscar Campo

Oscar Campo

124 сообщений из 298 понравились пользователям.

Группа: 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 Опубликовано: 11.10.2010 20:53:08
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3730 понравились пользователям.

Группа: 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 Опубликовано: 12.10.2010 02:30:05
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: 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 Опубликовано: 12.10.2010 09:35:59
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3730 понравились пользователям.

Группа: 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 пользователям понравился этот пост
Radovan Omorjan 12.10.2010 09:56:00
#8 Опубликовано: 12.10.2010 12:58:59
Oscar Campo

Oscar Campo

124 сообщений из 298 понравились пользователям.

Группа: 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 пользователям понравился этот пост
Andrey Ivashov 12.10.2010 13:14:00, Radovan Omorjan 12.10.2010 14:19:00
#9 Опубликовано: 28.04.2012 09:57:52
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: 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 пользователям понравился этот пост
Oscar Campo 30.04.2012 08:00:00, Mark R Harris 18.11.2022 05:09:00
#10 Опубликовано: 23.05.2022 12:53:25
banxyrock35

banxyrock35

0 сообщений из 1 понравились пользователям.

Группа: 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 Опубликовано: 18.11.2022 05:12:57
Mark R Harris

Mark R Harris

4 сообщений из 90 понравились пользователям.

Группа: 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 Опубликовано: 19.11.2022 16:18:23
Mark R Harris

Mark R Harris

4 сообщений из 90 понравились пользователям.

Группа: 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 пользователям понравился этот пост
churichuro 19.11.2022 19:38:00
#13 Опубликовано: 19.11.2022 18:37:15
overlord

overlord

551 сообщений из 1332 понравились пользователям.

Группа: 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 пользователям понравился этот пост
churichuro 19.11.2022 19:40:00, Mark R Harris 19.11.2022 22:48:00
#14 Опубликовано: 19.11.2022 19:39:45
churichuro

churichuro

28 сообщений из 79 понравились пользователям.

Группа: 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 Опубликовано: 19.11.2022 22:56:12
Mark R Harris

Mark R Harris

4 сообщений из 90 понравились пользователям.

Группа: 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 Опубликовано: 20.11.2022 08:27:40
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: 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 КиБ) скачан 34 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Mark R Harris 20.11.2022 15:26:00
#17 Опубликовано: 20.11.2022 15:26:54
Mark R Harris

Mark R Harris

4 сообщений из 90 понравились пользователям.

Группа: User

Thank you Martin, excellent.
#18 Опубликовано: 23.12.2022 13:50:27
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

74 сообщений из 164 понравились пользователям.

Группа: 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 пользователям понравился этот пост
Mark R Harris 23.12.2022 20:16:00, Alvaro Diaz Falconi 24.12.2022 14:41:00
#19 Опубликовано: 30.12.2022 04:51:38
sanitaro25

sanitaro25

0 сообщений из 1 понравились пользователям.

Группа: User

useful information
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений