const maskBaseStyle = {
width: '100px',
height: '100px',
background: 'blue',
};
const webkitMaskStyle = {
WebkitMaskImage: 'url("https://static.thenounproject.com/png/824030-200.png")',
WebkitMaskPosition: 'center',
WebkitMaskSize: 'contain',
};
const maskStyle = {
mask: 'url("https://static.thenounproject.com/png/824030-200.png")',
maskPosition: 'center',
maskSize: 'contain',
};
const MaskComponent = () => {
return (
<span
style={{
...maskBaseStyle,
...webkitMaskStyle,
...maskStyle,
}}
></span>
);
};
export default MaskComponent;
#how to give the WebkitMaskImage and mask , the pauseWhenLoading = {true} attribute like Img tag's.
6 messages · Page 1 of 1 (latest)
can you elaborate further what you would like to achieve?
I'm not quite grasping it from this snippet
I am trying to change the color of an png using the png image as a mask : https://stackoverflow.com/questions/61370618/how-to-replace-color-of-png-image-using-css?noredirect=1&lq=1
I usually use filter: hue-rotate()
or <svg> <filter> <feFlood /> </filter> <image src={your png} /> </svg>
filter: hue-rotate() yes this can change color but i cant like : pass the color and use the color automatically . no?
@tepid pagoda I think you can indeed wrap the <Img> tag in a <div> that uses a mask image
but then you would add the <Img> tag to the code snippet
I guess I am confused because you are not using it