User Tools

Site Tools


en:color

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:color [2020/11/22 21:05]
admin
en:color [2020/11/22 21:26] (current)
admin
Line 3: Line 3:
 ==== Format ==== ==== Format ====
  
-**color** [[colorconstants|color_name]]\\ +**color** color\\ 
-**color** ( [[colorconstants|color_name]] )\\ +**color** ( color )\\ 
-**color** [[rgb|rgb_expression]]\\ +**color** pen_colorbrush_color\\ 
-**color** ( [[rgb|rgb_expression]] )\\ +**color** ( pen_colorbrush_color )
-**color** [[expression|svg_color_string]]\\ +
-**color** ( [[expression|svg_color_string]] )\\ +
-**color** [[colorconstants|pen_color_name]] [[colorconstants|brush_color_name]]\\ +
-**color** ( [[colorconstants|pen_color_name]] [[colorconstants|brush_color_name]] )\\ +
-**color** [[rgb|pen_rgb_expression]] , [[rgb|brush_rgb_expression]]\\ +
-**color** ( [[rgb|pen_rgb_expression]] , [[rgb|brush_rgb_expression]] )\\ +
-**color** [[expression|pen_svg_color_string]], [[expression|brush_svg_color_string]]\\ +
-**color** ( [[expression|pen_svg_color_string]], [[expression|brush_svg_color_string]] )\\+
  
 ==== Description ==== ==== Description ====
  
-Sets the current drawing color to //colorname// or to an ARGB value where ((a * 256 + r) * 256 + g) * 256 + b.  If a single color is specified both the pen and the brush will be set to the same color.  There are 4 common ways to define a color in BASIC256:+Sets the current drawing color to //colorname// or to an ARGB value where ((a * 256 + r) * 256 + g) * 256 + b.  If a single color is specified both the pen and the brush will be set to the same color.  There are several ways to define a color in BASIC256:
  
   - one of the defined color constants (see table below);   - one of the defined color constants (see table below);
Line 27: Line 19:
     * b - blue 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,   - the [[rgb|rgb]] function passing it 3 or 4 numbers from 0-255,
-  - or using an svg color definition string.+  - using an svg color name as a string [[https://www.w3.org/TR/SVG11/types.html#ColorKeywords|as defined by the W3C]], 
 +  - or using a string with a "#" followed by 6 or 8 hexadecimal digits ("#ff0000", "#a0ffffff")
  
  
Line 53: Line 46:
 color rgb(255,160,160) color rgb(255,160,160)
 circle 100,100,25 circle 100,100,25
 +
 +penwidth 5
 +color "firebrick","#fab856"
 +rect 150,150,100,100
 +
 +color "papayawhip", "clear"
 +rect 175,175,100,100
 </code> </code>
-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}}
  
  
en/color.1606104358.txt.gz · Last modified: 2020/11/22 21:05 by admin