This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:color [2016/08/08 14:29] admin |
en:color [2020/11/22 21:26] admin |
||
---|---|---|---|
Line 3: | Line 3: | ||
==== Format ==== | ==== Format ==== | ||
- | **color** // | + | **color** color\\ |
- | **color** ( // | + | **color** ( color )\\ |
- | **color** // | + | **color** |
- | **color** ( // | + | **color** ( pen_color, brush_color |
- | **color** // | + | |
- | **color** ( // | + | |
- | **color** | + | |
- | **color** ( // | + | |
==== Description ==== | ==== Description ==== | ||
- | Sets the current drawing color to // | + | Sets the current drawing color to // |
+ | |||
+ | - one of the defined color constants (see table below); | ||
+ | - an integer to define the color where ((a * 256 + r) * 256 + g) * 256 + b, | ||
+ | * a - transparency 0 = transparent to 255 = opaque | ||
+ | * r - red 0 = off to 255 = full on | ||
+ | * g - green 0 = off to 255 = full on | ||
+ | * b - blue 0 = off to 255 = full on | ||
+ | - the [[rgb|rgb]] function passing it 3 or 4 numbers from 0-255, | ||
+ | - using an svg color name as a string [[https:// | ||
+ | - or using a string with a "#" | ||
When drawing solid shapes ([[Chord|Chord]], | When drawing solid shapes ([[Chord|Chord]], | ||
Line 20: | Line 27: | ||
If the current pen and brush are both set to CLEAR the pixels or shapes drawn will clear the pixels of the graphics output area and make them transparent. | If the current pen and brush are both set to CLEAR the pixels or shapes drawn will clear the pixels of the graphics output area and make them transparent. | ||
- | ===Color names and RGB values=== | + | {{page>en:colorconstants}} |
- | ^Color Name^ARGB Values^Integer^^ | + | |
- | |black|255, 0, 0, 0|4278190080|{{:color_black.png|Black}}| | + | |
- | |white|255, 255, 255, 255|4294506744|{{: | + | |
- | |red|255, 255, 0, 0|4294901760|{{: | + | |
- | |darkred|255, | + | |
- | |green|255, 0, 255, 0|4278255360|{{: | + | |
- | |darkgreen|255, | + | |
- | |blue|255, 0, 0, 255|4278190335|{{: | + | |
- | |darkblue|255, | + | |
- | |cyan|255, 0, 255, 255|4278255615|{{: | + | |
- | |darkcyan|255, | + | |
- | |purple|255, | + | |
- | |darkpurple|255, | + | |
- | |yellow|255, | + | |
- | |darkyellow|255, | + | |
- | |orange|255, | + | |
- | |darkorange|255, | + | |
- | |grey|255, 164, 164 , | + | |
- | |darkgrey|255, | + | |
- | |clear|0, 0, 0, 0|0|| | + | |
==== Deprecated Form ==== | ==== Deprecated Form ==== | ||
Line 59: | Line 46: | ||
color rgb(255, | color rgb(255, | ||
circle 100,100,25 | circle 100,100,25 | ||
+ | |||
+ | penwidth 5 | ||
+ | color " | ||
+ | rect 150, | ||
+ | |||
+ | color " | ||
+ | rect 175, | ||
</ | </ | ||
- | Will draw a grey rectangle with a green circle filled with red and then a pink circle inside it.\\ | + | Will draw the following:\\ |
- | {{:color.png|Color}} | + | {{:color2.png|Color}} |
Line 72: | Line 66: | ||
|0.9.9.28|Changed color values to include Alpha (transparency) and changed color constants to new ARGB values.| | |0.9.9.28|Changed color values to include Alpha (transparency) and changed color constants to new ARGB values.| | ||
|0.9.9.45|changed values to positive numbers following formula as documented.| | |0.9.9.45|changed values to positive numbers following formula as documented.| | ||
+ | |2.0.99.4|Added ability to use string names and hex values for colors.| |