mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
gradients
This commit is contained in:
parent
42a5efd09d
commit
80904d7d19
3 changed files with 92 additions and 10 deletions
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
;;; A very brief example of using the canvas control.
|
||||
(defun on-new-window (body)
|
||||
(debug-mode body)
|
||||
(setf (title (html-document body)) "Tutorial 10")
|
||||
(let* ((canvas (create-canvas body :width 600 :height 400))
|
||||
(cx (create-context2d canvas))
|
||||
|
|
@ -17,8 +16,12 @@
|
|||
(setf (fill-style cx) :blue
|
||||
(font-style cx) "bold 24px serif")
|
||||
(fill-text cx "Hello World" 10 150)
|
||||
(setf (fill-style cx) :red)
|
||||
(begin-path cx)
|
||||
(let ((gr (create-linear-gradient cx 20 0 220 0)))
|
||||
(add-color-stop gr 0 :red)
|
||||
(add-color-stop gr .5 :cyan)
|
||||
(add-color-stop gr 1 :yellow)
|
||||
(setf (fill-style cx) gr))
|
||||
(ellipse cx 200 200 50 7 0.78 0 6.29)
|
||||
(path-stroke cx)
|
||||
(path-fill cx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue