Original Author Paul Laughton, 2011
Page 158
De Re BASIC!
Graphics Setup Commands
Gr.open {{alpha}{, red}{, green}{, blue}{, <ShowStatusBar_lexp>}{,
<Orientation_nexp>}}
Opens the Graphics Screen and puts BASIC! into Graphics Mode. The color values become the
background color of the graphics screen. The default color is opaque white (255,255,255,255).
All parameters are optional; use commas to indicate omitted parameters (see Optional Parameters).
Each of the four color components is a numeric expression with a value from 0 through 255. If a value is
outside of this range, only the last eight bits of the value are used; for example, 257 and 1025 are the
same as 1. If any color parameter is omitted, it is set to 255.
The Status Bar will be shown on the graphics screen if the <ShowStatusBar_lexp> is true (not zero). If the
<ShowStatusBar_lexp> is not present, the Status Bar will not be shown.
The orientation upon opening graphics will be determined by the <Orientation_nexp> value.
<Orientation_nexp> values are the same as values for the Gr.orientation command (see below). If the
<Orientation_nexp> is not present, the default orientation is Landscape.
Gr.color {{alpha}{, red}{, green}{, blue}{, style}{, paint}}
Sets the color and style for drawing objects. There are two ways to use this command.
Basic usage: ignore the optional <paint> parameter. The new color and style will be used for
whatever graphical objects are subsequently drawn until the next Gr.color command is executed.
Advanced usage: The "basic usage" of this command always creates a new Paint. If you prefer, you
can use the <paint> parameter to specify an existing Paint. The Gr.color command sets the color and
style of that Paint, changing the appearance of any graphical object to which it is attached. The
current Paint is not changed. See "Paints Advanced Usage" above and the example below.
All of the parameters are optional. If a color component or the style is omitted, that component is left
unchanged. For example, Gr.color ,,0 sets only green to 0, leaving alpha, red, blue, and style as they
were. Use commas to indicate omitted parameters (see Optional Parameters).
Each of the four color components (alpha, red, green, blue) is a numeric expression with a value from 0
through 255. If a value is outside of this range, only the last eight bits of the value are used; for example,
257 and 1025 are both the same as 1.
The style parameter, is a numeric expression that determines the stroking and filling of objects. The
effect of this parameter is explained in detail in the "Style" sections, see above. The possible values for
<style_nexp> are shown in this table:
Value
Meaning
Description
0
STROKE
Geometry and text drawn with this style will be stroked (outlined),
respecting the stroke-related fields on the paint.
1
FILL
Geometry and text drawn with this style will be filled, ignoring all