
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML canvas shadowColor Property
The shadowColor property of the HTML canvas is used to set the color for shadow. The default value is #000000.
Following is the syntax −
ctx.shadowColor=color;
Above, set the color for shadow.
Let us now see an example to implement the shadowColor property of canvas −
Example
<!DOCTYPE html> <html> <body> <canvas id="newCanvas" width="600" height="350" style="border:2px solid orange;"> </canvas> <script> var c = document.getElementById("newCanvas"); var ctx = c.getContext("2d"); ctx.shadowBlur = 20; ctx.shadowColor = "gray"; ctx.fillStyle = "blue"; ctx.fillRect(40, 40, 200, 250); </script> </body> </html>
Output
Advertisements