
16 How do you change the color of your brush?.15 How do I change the gradient color in Canva?.14 Why is my gradient tool not working?.13 How do you apply a gradient as the background for the slide?.12 How do you add gradient fill data bars in Excel?.11 How do you do a rainbow gradient in Inkscape?.10 How do I add gradient points in Inkscape?.9 Which tool allows you to modify a gradient?.8 How do you add opacity to a linear gradient?.6 Where is the gradient Transform tool?.5 How do you change the color of a gradient?.3 How do you fill a gradient color in Inkscape?.Then we can apply the mask to our image with mask-image as usual by refecencing the ID of the SVG mask. Here’s the SVG markup for the first example: See the Pen mdPBExv by alligatorio ( on CodePen. The colors also work in reverse and white/partially white is what will be visible. The first image is our default starting image, and the second image has our linear gradient applied as the mask-image value:Īlso note that with SVG masks, the colors to use are white and black instead of transparent and black. Let’s first use a simple linear gradient that goes from transparent to black. Let’s go over the 3 possibilities for image masks with concrete examples: Masking Using Gradients SVGs that use the mask element can also be used as the image mask. Linear and radial gradients in CSS are generated images, so they can be used as the image mask. Anything that’s 100% black in the image mask with be completely visible, anything that’s 100% transparent will be completely hidden, and anything in-between will partially mask the image.

Masking in CSS is done using the mask-image property, and an image has to be provided as the mask.

Contrary to clipping, where a part of an image or element is either completely invisible or completely visible, with masking we can hide or show parts of an image with different levels of opacity. We covered the use of the clip-path property for clipping using CSS, so it’s only natural that we now go over masking.
