What are gradients in Canvas used for? What are their different types?

0

Gradients in canvas are used to fill rectangles, circles, lines etc.

The gradients in Canvas are of two types:

  1. createLinearGradient(x,y,x1,y1) – It creates a linear gradient
  2. createRadialGradient(x,y,r,x1,y1,r1) – It creates a radial/circular gradient

 

asked Apr 15, 2023 at 00:20
Sign in to add a comment

0 Answers

0
📝 No answers yet!

Be the first to answer this interview question.

Your Answer

Sign in to post your answer and help the community.