qtxie / notes

0 stars 0 forks source link

DRAW shadow #4

Open qtxie opened 4 years ago

qtxie commented 4 years ago
shadow off|<offset> <blur> <spread> <color> inset

The shadow command define a shadow effect (or several) which apply to the following draw commands. For examples:

view [
    base 300x300 white draw [
        fill-pen white
        shadow 5x10 18 255.0.0
        box 50x50 150x150
    ]
]

This will draw a box with red shadow: image

You can also apply multiple shadow effects.

view [
    base 300x300 white draw [
        fill-pen white
        shadow 5x10 18 255.0.0
        shadow -5x-10 18 0.0.255
        box 50x50 150x150
    ]
]

image

The shadow effect will apply to all the shapes until it's turned off.

view [
    base 300x300 white draw [
        fill-pen white
        shadow 5x10 18 255.0.0
        shadow -5x-10 18 0.0.255
        box 30x30 130x130            ;-- has shadow
        circle 200x200 50            ;-- has shadow
        shadow off
        box 200x30 280x110           ;-- no shadow
    ]
]