W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2014

Re: fill and stroke properties with CSS <image> values

From: Jeremie Patonnier <jeremie.patonnier@gmail.com>
Date: Thu, 23 Jan 2014 11:45:03 +0100
Message-ID: <CAEi838==jz3scF3kD0nO-Pw_ptrDwS8SpW+xm51TvSRq+_ww9A@mail.gmail.com>
To: Erik Dahlström <ed@opera.com>
Cc: Dirk Schulze <dschulze@adobe.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, www-svg <www-svg@w3.org>, public-fx <public-fx@w3.org>
Hi!

2014/1/23 Erik Dahlström <ed@opera.com>

> I'm wondering how much of a need there really is to have the fallback
> color in the first place, maybe this is something we should revisit?
>

Let's imagine the following use case:

   1. You have an SVG image with a white background
   2. I have a rect fill with a dark image (fill: url("stuff.png"))
   3. I write some text on top of the rect which color is white
   4. If for some reason the image is not loading, the text become not
   visible (white text on a white background)

Having a fallback color (let's say black) is a safety for such cases.

Another case is if you want to have an image that fade to a colored
background. In such case, it's better to fill with an image as small as
possible and fill the blank with the appropriate color instead of having a
large image mostly full of a plain color. This is more efficient in term of
network performance (we load a smaller resource) and rendering performance
(the color can be paint immediately, even if the image take some time to
load).

Best,
-- 
Jeremie
.............................
Web : http://jeremie.patonnier.net
Twitter : @JeremiePat <http://twitter.com/JeremiePat>
Received on Thursday, 23 January 2014 10:46:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:48 UTC