Tint image using CSS without overlay

后端 未结 5 463
时光取名叫无心
时光取名叫无心 2020-12-02 20:36

Is it possible to tint an image with a specific color using CSS without an overlay in a WebKit browser?

Failed attempts

  • Managed to tin
5条回答
  •  有刺的猬
    2020-12-02 21:10

    Eventually it will be, using shaders. See the W3C Docs on Filters.

    At the moment, what is possible for instance is:

    -webkit-filter: grayscale; /*sepia, hue-rotate, invert....*/
    -webkit-filter: brightness(50%); 
    

    See

    • David Walsh on CSS Filters
    • Stackoverflow: apply a rose tint...:
    • W3C Filter Effects 1.0 Docs - 38.2.5. Other uniform variables: the CSS shaders parameters

    Update:

    Adobe released its HTML5 based CSS Filter Labs with support for custom filters (Shaders) on supported browsers:

    enter image description here

提交回复
热议问题