Loading ...
Sorry, an error occurred while loading the content.
 

Re: "Spray Paint" Fill

Expand Messages
  • skatethere
    ... [...] ... single ... density ... I would think you would want to experiment with feTurbulence to create a non-continuous color distribution, similar to the
    Message 1 of 4 , Mar 4, 2004
      --- In svg-developers@yahoogroups.com, "Grant Mc Auley"
      <gmcauley@s...> wrote:
      > To clarify:
      [...]
      > So, really what I want is: a white background, overlaid with a
      single
      > color that is distributed finely and discretely with a constant
      density
      > (like a "gas").

      I would think you would want to experiment with feTurbulence to create
      a non-continuous color distribution, similar to the demonstration at:

      http://jan.kollhof.net/projects/svg/examples/brushed.svg

      For example, slightly modifying Jan's filters, I generated the
      following, which seems to fit your description:

      <defs>

      <filter id="gaseousnoise" filterUnits="objectBoundingBox" x="-10%"
      y="-10%" width="120%" height="120%" >
      <!-- create noise. Adjust freq to achieve desired granularity
      -->
      <feTurbulence type="fractalNoise" baseFrequency="0.1"
      numOctaves="4" seed="1" result="fnoise"/>
      <!-- desaturate (so we can apply SourceGraphic color later) -->
      <feColorMatrix
      type="saturate" in="fnoise" values="0" result="desat"/>
      <!-- white source to lighten image. Adjust opacity as desired
      -->
      <feFlood flood-color="#FFFFFF" flood-opacity=".3"
      result="flood"/>
      <!-- combine white background with texture -->
      <feMerge result="lighten">
      <feMergeNode in="flood"/>
      <feMergeNode in="desat"/>
      </feMerge>
      <!-- combine with source object -->
      <feComposite in="lighten" in2="SourceGraphic"
      operator="arithmetic" k1="0" k2="1" k3="1" k4="0"
      result="merge"/>
      <!-- clip the result to the mask of the object -->
      <feComposite in="merge" in2="SourceAlpha"
      operator="in" result="mask"/>
      </filter>
      </defs>
      <rect
      width="400"
      height="200"
      x="100"
      y="200"
      fill="#C0C0FF" filter="url(#gaseousnoise)"/>

      --kirby
    Your message has been successfully submitted and would be delivered to recipients shortly.