COLREAD (Command)

is a command which reads colour information from the graphics system. It has four parameters, and the first is a pair of values in parentheses. The first value of the pair is a string, and should be,  , or   (anything else results in   error). The second value of the pair is a number, which is rounded down to an integer, and the rounded value should be between 0 and 255 inclusive (anything else results in  error). The second, third, and fourth parameters to the command are variable names, and those variables are assigned the red, green, and blue values corresponding to the colour specified.

As an example, the command  will typically cause the variable   to get the value 33, the variable   to get the value 57, and the variable   to get the value 132.

The default values are as follows: or    R  G  B  R  G  B    0 0 0  0  0  0  0   1  58  57  58  58  57  58   2  255  24  0  255  24  0   3  255  89  197  255  89  197   4  0  57  247  0  57  247   5  123  57  255  123  57  255   6  0  186  255  0  186  255   7  148  89  41  148  89  41   8  255  162  0  255  162  0   9  255  202  165  255  202  165   10  0  121  0  0  121  0   11  0  243  25  0  243  25   12  255  227  0  255  227  0   13  189  186  189  189  186  189   14  0  0  0  0  0  0   15  255  251  255  255  251  255   16  0  0  0  0  0  0   17  41  40  41  41  40  41   18  140  49  41  140  49  41   19  156  89  132  156  89  132   20  33  57  132  33  57  132   21  99  73  148  99  73  148   22  41  113  140  41  113  140   23  90  65  49  90  65  49   24  140  97  41  140  97  41   25  165  146  132  165  146  132   26  16  65  16  16  65  16   27  33  130  49  33  130  49   28  140  121  41  140  121  41   29  132  130  132  132  130  132   30  255  251  255  255  251  255   31  0  0  0  0  0  0   32  0  0  0  255  251  255   33  16  49  82  255  251  206   34  66  97  255  255  251  156   35  181  210  255  255  251  99   36  173  0  0  255  251  49   37  255  65  16  255  251  0   38  255  194  189  255  202  255   39  115  73  25  255  202  206   40  206  178  123  255  202  156   41  255  227  181  255  202  99   42  66  65  66  255  202  49   43  148  146  148  255  202  0   44  230  227  230  255  154  255   45  255  251  255  255  154  206   46  0  0  0  255  154  156   47  189  186  189  255  154  99   48  0  0  0  255  154  49   49  82  0  0  255  154  0   50  181  24  0  255  97  255   51  255  97  82  255  97  206   52  74  65  16  255  97  156   53  123  97  49  255  97  99   54  197  162  99  255  97  49   55  115  105  0  255  97  0   56  189  178  0  255  49  255   57  255  251  0  255  49  206   58  90  57  255  255  49  156   59  148  130  255  255  49  99   60  222  210  255  255  49  49   61  255  251  255  255  49  0   62  0  0  0  255  0  255   63  255  227  0  255  0  206   64  0  0  0  255  0  156   65  123  0  0  255  0  99   66  255  40  25  255  0  49   67  255  146  107  255  0  0   68  0  73  255  206  251  255   69  0  178  255  206  251  206   70  82  251  255  206  251  156   71  140  73  0  206  251  99   72  197  154  90  206  251  49   73  255  202  123  206  251  0   74  0  113  0  206  202  255   75  0  227  0  206  202  206   76  156  251  156  206  202  156   77  255  251  255  206  202  99   78  0  0  0  206  202  49   79  0  243  25  206  202  0   80  0  0  0  206  154  255   81  0  73  165  206  154  206   82  107  130  255  206  154  156   83  181  210  255  206  154  99   84  33  73  8  206  154  49   85  33  146  0  206  154  0   86  16  243  0  206  97  255   87  140  97  49  206  97  206   88  189  170  82  206  97  156   89  239  227  156  206  97  99   90  148  32  0  206  97  49   91  222  65  0  206  97  0   92  255  130  74  206  49  255   93  255  251  255  206  49  206   94  0  0  0  206  49  156   95  0  121  0  206  49  99   96  0  0  0  206  49  49   97  99  81  0  206  49  0   98  255  251  0  206  0  255   99  255  251  156  206  0  206   100  156  0  66  206  0  156   101  255  0  132  206  0  99   102  255  178  214  206  0  49   103  148  97  25  206  0  0   104  214  194  123  156  251  255   105  255  251  239  156  251  206   106  33  178  0  156  251  156   107  99  251  74  156  251  99   108  206  251  189  156  251  49   109  255  251  255  156  251  0   110  0  0  0  156  202  255   111  255  202  165  156  202  206   112  0  0  0  156  202  156   113  99  0  107  156  202  99   114  255  0  255  156  202  49   115  255  113  255  156  202  0   116  74  73  0  156  154  255   117  189  178  16  156  154  206   118  255  251  0  156  154  156   119  181  97  25  156  154  99   120  247  194  123  156  154  49   121  255  251  239  156  154  0   122  66  65  255  156  97  255   123  132  130  255  156  97  206   124  222  219  255  156  97  156   125  255  251  255  156  97  99   126  0  0  0  156  97  49   127  255  162  0  156  97  0   128  0  0  0   129  74  32  8   130  99  57  16   131  123  65  25   132  148  89  41   133  181  121  66   134  206  170  115   135  33  113  0   136  16  162  16   137  74  210  90   138  148  138  230   139  189  178  239   140  222  210  255   141  255  251  255   142  0  0  0   143  148  89  41   144  0  0  0   145  33  0  0   146  66  24  0   147  132  57  0   148  132  73  33   149  148  97  41   150  165  121  74   151  0  49  0   152  0  97  25   153  33  154  66   154  99  65  181   155  165  138  214   156  197  178  247   157  181  219  255   158  0  0  0   159  0  186  255   160  0  0  0   161  0  32  0   162  41  81  41   163  90  121  90   164  132  170  132   165  181  210  181   166  230  251  230   167  132  89  0   168  173  146  49   169  214  202  148   170  132  105  0   171  255  251  0   172  255  251  214   173  255  251  255   174  0  0  0   175  123  57  255   176  0  0  0   177  58  57  58   178  82  81  90   179  123  121  132   180  156  162  173   181  181  186  197   182  206  210  230   183  222  121  0   184  255  194  16   185  255  251  90   186  230  24  0   187  255  97  58   188  255  154  156   189  255  251  255   190  0  0  0   191  0  57  247   192  0  0  0   193  0  32  132   194  16  49  148   195  58  81  165   196  115  138  197   197  173  186  230   198  222  227  255   199  8  32  58   200  99  113  156   201  181  202  255   202  132  8  0   203  255  32  0   204  255  210  173   205  255  251  255   206  0  0  0   207  255  89  197   208  0  0  0   209  148  40  0   210  156  57  25   211  173  81  49   212  197  113  99   213  239  178  165   214  255  210  206   215  58  32  8   216  156  113  99   217  255  202  181   218  0  8  156   219  0  130  255   220  173  210  255   221  255  251  255   222  0  0  0   223  255  24  0   224  0  0  0   225  41  49  0   226  82  89  25   227  115  113  49   228  156  154  74   229  197  194  107   230  247  243  140   231  107  89  0   232  165  113  0   233  230  210  132   234  132  8  148   235  255  32  173   236  255  170  255   237  255  251  255   238  0  0  0   239  58  57  58   240  99  97  99  0  49  49   241  123  121  123  0  49  0   242  132  130  132  0  0  255   243  148  146  148  0  0  206   244  156  154  156  0  0  156   245  165  162  165  0  0  99   246  173  170  173  0  0  49   247  189  186  189  239  235  239   248  197  194  197  222  219  222   249  206  202  206  189  186  189   250  214  210  214  173  170  173   251  230  227  230  140  138  140   252  49  49  49  115  113  115   253  181  178  181  82  81  82   254  0  0  0  66  65  66   255  239  235  239  33  32  33

It is interesting to note that no  value ever goes above 251. It is also interesting to note the regularity of RGB values in the  colours between 32 and 246: the starting triple is 255, 251, 255, then the green cycles through the values 255, 206, 156, 99, 49, 0, for each cycle of green values the blue values go one step through the cycle 251, 202, 154, 97, 49, 0, and for each cycle of blue values the red values go one step through the cycle 255, 206, 156, 99, 49, 0 (same as the green values) - except the pattern is broken at the very end, where one would expect colour number 247 to be black. Since black is available as colour 31, there is a regular 6*6*6 grid of points in the RGB colour space in the set above.