Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 116 - 2505_CoreGPT(Podar)_Flipbook_C7
P. 116

    COLOURS IN GRAPHICS

                      In BASIC-256, the COLOR command is used to set the drawing colour for shapes, lines and text.

                      The colour is specified using the RGB model, where:
                          ✶  R: Red (value from 0 to 255)
                          ✶  G: Green (value from 0 to 255)

                          ✶  B: Blue (value from 0 to 255)

                      Syntax:
                      COLOR r, g, b
                      Here are a few examples of RGB values and output color:

                       Color Name       RGB Value      Output Color       Color Name       RGB Value      Output Color

                       Black               0, 0, 0                       Purple            255, 0, 255

                       White            255, 255, 255                    Dark Purple       128, 0, 128
                       Red                255, 0, 0                      Yellow            255, 255, 0

                       Dark Red           128, 0, 0                      Dark Yellow       128, 128, 0

                       Green              0, 255, 0                      Orange            255, 102, 0

                       Dark Green         0, 128, 0                      Dark Orange        176. 61, 0

                       Blue               0, 0, 255                      Grey             164, 164, 164

                       Dark Blue          0, 0, 128                      Dark Grey        128, 128, 128

                       Cyan              0, 255, 255                     Clear                0, 0, 0

                      The COLOR r, g, b command sets the drawing colour to the specified values of red, green and
                      blue.

                      Program 3: To draw a red line.

                    114     Premium Edition-VII

| 111 112 113 114 115 116 117 118 119 120 121 |