Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline oscampo  
#1 Posted : 11 October 2010 20:16:48(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
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

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline omorr  
#2 Posted : 11 October 2010 20:51:20(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
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!"
Offline Andrey Ivashov  
#3 Posted : 11 October 2010 21:17:38(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Hello.

Here is a complete list of possible colors (spaces and upper case letters are not matter):
Code:
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.

Edited by user 11 October 2010 21:24:00(UTC)  | Reason: Not specified

Offline oscampo  
#4 Posted : 11 October 2010 22:03:11(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
Thank you so much.
Only a little question: I was trying with numbres instead color names, but no result. I tryed the following:
Offline Andrey Ivashov  
#5 Posted : 12 October 2010 03:53:08(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Ah, yes... I forgot about opacity Good 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 Biggrin

Regards.
Offline omorr  
#6 Posted : 12 October 2010 09:30:05(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
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 Good

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Andrey Ivashov  
#7 Posted : 12 October 2010 16:35:59(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
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.
thanks 1 user thanked Andrey Ivashov for this useful post.
on 12/10/2010(UTC)
Offline oscampo  
#8 Posted : 12 October 2010 19:58:59(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
Thank you so much Andrey, I was working in this idea, so here is my version (using some lines of your code Wink ):



Snippet: RGBcolor.sm

Regards,
Oscar
thanks 2 users thanked oscampo for this useful post.
on 12/10/2010(UTC),  on 12/10/2010(UTC)
Offline Davide Carpi  
#9 Posted : 28 April 2012 16:57:52(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
oscampo wrote:
Thank you so much Andrey, I was working in this idea, so here is my version (using some lines of your code Wink ):

[...]

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

Edited by user 28 April 2012 17:29:24(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 2 users thanked Davide Carpi for this useful post.
on 30/04/2012(UTC),  on 18/11/2022(UTC)
Offline banxyrock35  
#10 Posted : 23 May 2022 18:53:25(UTC)
banxyrock35

Rank: Newbie

Groups: Registered
Joined: 23/05/2022(UTC)
Posts: 1
Netherlands
Location: Amsterdam

Originally Posted by: Andrey Ivashov Go to Quoted Post
Hello.

Here is a complete list of possible colors (spaces and upper case letters are not matter):
Code:
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.
Offline marks2c  
#11 Posted : 18 November 2022 11:12:57(UTC)
marks2c


Rank: Advanced Member

Groups: Registered
Joined: 01/04/2020(UTC)
Posts: 85
New Zealand
Location: Wellington

Was thanked: 4 time(s) in 3 post(s)
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.

Originally Posted by: Davide Carpi Go to Quoted Post
oscampo wrote:
Thank you so much Andrey, I was working in this idea, so here is my version (using some lines of your code Wink ):

[...]

...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

Edited by user 19 November 2022 22:58:40(UTC)  | Reason: PBKAC

Offline marks2c  
#12 Posted : 19 November 2022 22:18:23(UTC)
marks2c


Rank: Advanced Member

Groups: Registered
Joined: 01/04/2020(UTC)
Posts: 85
New Zealand
Location: Wellington

Was thanked: 4 time(s) in 3 post(s)
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.

Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: marks2c Go to Quoted Post
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 ...



thanks 1 user thanked marks2c for this useful post.
on 20/11/2022(UTC)
Offline overlord  
#13 Posted : 20 November 2022 00:37:15(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

Was thanked: 506 time(s) in 337 post(s)
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.
thanks 2 users thanked overlord for this useful post.
on 20/11/2022(UTC),  on 20/11/2022(UTC)
Offline churichuro  
#14 Posted : 20 November 2022 01:39:45(UTC)
churichuro


Rank: Advanced Member

Groups: Registered
Joined: 27/03/2019(UTC)
Posts: 75
Mexico
Location: coah

Was thanked: 27 time(s) in 22 post(s)
Jean, in the future please please review your responses to check they are on-topic (ie not SPAM) before hitting the 'POST' button. RTFM Wallbash
Offline marks2c  
#15 Posted : 20 November 2022 04:56:12(UTC)
marks2c


Rank: Advanced Member

Groups: Registered
Joined: 01/04/2020(UTC)
Posts: 85
New Zealand
Location: Wellington

Was thanked: 4 time(s) in 3 post(s)
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.
Offline mkraska  
#16 Posted : 20 November 2022 14:27:40(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: marks2c Go to Quoted Post
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 (4kb) downloaded 15 time(s).

Edited by user 20 November 2022 20:35:52(UTC)  | Reason: Not specified

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 20/11/2022(UTC)
Offline marks2c  
#17 Posted : 20 November 2022 21:26:54(UTC)
marks2c


Rank: Advanced Member

Groups: Registered
Joined: 01/04/2020(UTC)
Posts: 85
New Zealand
Location: Wellington

Was thanked: 4 time(s) in 3 post(s)
Thank you Martin, excellent.
Offline Kenny Lemens  
#18 Posted : 23 December 2022 19:50:27(UTC)
Kenny Lemens


Rank: Advanced Member

Groups: Registered
Joined: 11/01/2018(UTC)
Posts: 131
Man
United States
Location: Wisconsin

Was thanked: 58 time(s) in 37 post(s)
Greetings,

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

Originally Posted by: Davide Carpi Go to Quoted Post
...
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/G...%2fRGB-RGBA%20colors.zip
- https://smath.info/wiki/...hs%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 Banzai

Hotkeys: https://en.smath.com/for...rce.ashx?a=45771&b=2
thanks 2 users thanked Kenny Lemens for this useful post.
on 24/12/2022(UTC),  on 24/12/2022(UTC)
Offline sanitaro25  
#19 Posted : 30 December 2022 10:51:38(UTC)
sanitaro25

Rank: Newbie

Groups: Registered
Joined: 30/12/2022(UTC)
Posts: 1
United States
Location: NYC USA

useful information
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.