<< Click to Display Table of Contents >> Navigation: 3. Script Language > Image/Pixel-Color Operations > Undercover and Graphics > Undercover Operations |
MiniRobotLanguage (MRL)
UCV.gradient
UCV.grd
Fade between two colors on a cover
Intention
This command will change the background color of an existing cover or create an cover itself. It will paint the cover with an fading effect between two colors.
The effect can be horizontal or vertical.
Here is a simple example:
UCV.grd
PAU.5
ENR.
Below is the result, it uses the default gradient-colors.
Next we will use a custom gradient color. Like this:
UCV.nbi
UCV.grd|&HFF0000
PAU.5
ENR.
This will result in something like this (see below):
Now we will specify a second gradient color. Lets say green:
UCV.nbi
' red/green fading gradient
UCV.grd|&HFF0000|&H00FF00
PAU.5
ENR.
The following example shows that you can also write and paint on a gradient.
UCV.nbi
UCV.grd|&HFF0000|&H00FF00
UCV.fgr|&HFFFF00
UCV.write|Hello World!
FOR.$$XCO|1|2600|10
UCV.drawto|1,$$XCO|2*$$XCO,$$XCO*2
UCV.drawto|$$XCO,1|1,$$XCO
NEX.
PAU.5
ENR.
If you specify a "1" as third number:
UCV.grd|&HFF0000|&H00FF00|1
then the gradient will be horizontal instead of vertical.
UCV.nbi
UCV.grd|&HFF0000|&H00FF00|1
UCV.fgr|&HFFFF00
UCV.write|Hello World!
FOR.$$XCO|1|2600|10
UCV.drawto|1,$$XCO|2*$$XCO,$$XCO*2
UCV.drawto|$$XCO,1|1,$$XCO
NEX.
PAU.5
ENR.
Syntax
UCV.gradient[|P1][|P2][|P3]
UCV.grd[|P1][|P2][|P3]
Parameter Explanation
P1 - (optional) Color-value for first gradient color.
P2 - (optional) Color-value for second gradient color.
P3 - (optional) 0/1 - switches between a horizontal and a vertical gradient.
Example
'***********************************
' UCV.-Sample
'
'***********************************
'
UCV.nbi
UCV.grd|&HFF0000|&H00FF00
PAU.10
UCV.
ENR.
'***********************************
' UCV.-Sample 2
'
'***********************************
'
UCV.nbi
UCV.grd|&HFF0000|&H00FF00
UCV.fgr|&HFFFF00
UCV.write|Hello World!
FOR.$$XCO|1|2600|10
UCV.drawto|1,$$XCO|2*$$XCO,$$XCO*2
UCV.drawto|$$XCO,1|1,$$XCO
NEX.
PAU.5
ENR.
Remarks
-
Limitations:
-
See also:
• ! Smart Package Robot 's Undercover Operations
• ! UCV. - Undercover Graphics