|
Post by johnno56 on Sept 29, 2019 3:51:29 GMT -6
"In the beginning..." Relax. This is NOT a sermon. I think, way back in QBasic's earliest version, colour was anything but pretty. Compared to black and white, I suppose it could be, but no it wasn't. QB had four colours. Black, white, cyan and magenta. Most modern "Basics" now use RGB(). The rgb() function define colours using the Red-Green-Blue (RGB) model. An RGB colour value is specified with: rgb(red, green, blue). Each parameter defines the intensity of that colour and can be an integer between 0 and 255. For example, the rgb(0,0,255) value is rendered as blue, because the blue parameter is set to its highest value (255) and the others are set to 0. RGB() can render a possible 16,777,216 colours! (256 x 256 x 256)... Cool... Although the attached program is not a tutorial per se, it demonstrates how the RGB model works. Keys A and Z with change the RED value. Keys S ans X will change the GREEN value. Keys D and C will change the BLUE value. The resulting combinations of red, green and blue will be displayed along with its RGB values. rgbguide.zip (187.43 KB) How to define a colour in your program? Use the command: setColor() SetColor uses only one parameter. It can be used like: setColor(rgb(255,255,255)) - for the colour White - or white = rgb(255,255,255) setColor(white) I hope that this lesson will be of some use...
|
|
|
Post by n00b on Sept 29, 2019 9:13:18 GMT -6
This is a great intro to color. Maybe you could extend this to also cover RGBA as well. Good Job.
|
|
|
Colour 101
Sept 29, 2019 9:20:39 GMT -6
via mobile
Post by tbird on Sept 29, 2019 9:20:39 GMT -6
Nice johnno, keep em coming!
|
|
|
Post by johnno56 on Sept 29, 2019 14:51:40 GMT -6
My next tutorial will cover Graphics Primitives - I hope - and will include RGB and RGBA. There is SO much to cover in 'Primatives', I'm not sure how long it will take to get it done.
I am trying to focus on the 'basics' (no pun intended) for two main reasons. 1. Do not want to 'over load' the new-comer and 2. Quite frankly, there are features of RCBasic that I have never used. Ha! Looks like the tut will be for me as well... who knew?
Thank you both for the encouragement. I am 'not' a document writer and have only done one major tutorial. (Not Basic related) So, all of this, is relatively 'untested waters' in regards to Basic tutorials... lol
I will do my best so as not to disappoint or embarrass.
J
|
|
|
Post by eyfenna on Oct 2, 2019 12:24:13 GMT -6
Nicely done johnno.
|
|