Prev Demo
Circular Radial Pattern
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Circular radial pattern</title> </head> <body> <canvas id="Canvas" width="200" height="200"></canvas> <script> var canvas = document.getElementById('Canvas'); var context = canvas.getContext('2d'); context.rect(0, 0, 600, 250); var radial = context.createRadialGradient(100, 100, 50, 100, 100, 100); radial.addColorStop(1, 'yellow'); radial.addColorStop(0, 'red'); radial.addColorStop(0.3, 'blue'); context.fillStyle = radial; context.fill(); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output