You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/styles_and_colors.rst
+76Lines changed: 76 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,82 @@ Then use it as a ``fill_style`` or ``stroke_style``:
140
140
141
141
.. image:: images/pattern.png
142
142
143
+
Filters
144
+
-------
145
+
146
+
You can apply filters such as blurring and grayscaling to your drawings using the ``filter`` property. This property is similar to the filter CSS property and accepts the same values.
147
+
148
+
The ``filter`` property is a ``string`` with the following syntax:
A CSS url(). Takes an IRI pointing to an SVG filter element, which may be embedded in an external XML file.
159
+
160
+
- ``blur()``:
161
+
A CSS <length>. Applies a Gaussian blur to the drawing. It defines the value of the standard deviation to the Gaussian function, i.e., how many pixels on the screen blend into each other; thus, a larger value will create more blur. A value of 0 leaves the input unchanged.
162
+
163
+
- ``brightness()``:
164
+
A CSS <percentage>. Applies a linear multiplier to the drawing, making it appear brighter or darker. A value under 100% darkens the image, while a value over 100% brightens it. A value of 0% will create an image that is completely black, while a value of 100% leaves the input unchanged.
165
+
166
+
- ``contrast()``:
167
+
A CSS <percentage>. Adjusts the contrast of the drawing. A value of 0% will create a drawing that is completely black. A value of 100% leaves the drawing unchanged.
168
+
169
+
- ``drop-shadow()``:
170
+
Applies a drop shadow effect to the drawing. A drop shadow is effectively a blurred, offset version of the drawing's alpha mask drawn in a particular color, composited below the drawing. This function takes up to five arguments:
171
+
172
+
- <offset-x>: Specifies the horizontal distance of the shadow.
173
+
- <offset-y>: Specifies the vertical distance of the shadow.
174
+
- <blur-radius>: The larger this value, the bigger the blur, so the shadow becomes bigger and lighter. Negative values are not allowed.
175
+
- <color>: The shadow color.
176
+
177
+
- ``grayscale()``:
178
+
A CSS <percentage>. Converts the drawing to grayscale. A value of 100% is completely grayscale. A value of 0% leaves the drawing unchanged.
179
+
180
+
- ``hue-rotate()``:
181
+
A CSS <angle>. Applies a hue rotation on the drawing. A value of 0deg leaves the input unchanged.
182
+
183
+
- ``invert()``:
184
+
A CSS <percentage>. Inverts the drawing. A value of 100% means complete inversion. A value of 0% leaves the drawing unchanged.
185
+
186
+
- ``opacity()``:
187
+
A CSS <percentage>. Applies transparency to the drawing. A value of 0% means completely transparent. A value of 100% leaves the drawing unchanged.
188
+
189
+
- ``saturate()``:
190
+
A CSS <percentage>. Saturates the drawing. A value of 0% means completely un-saturated. A value of 100% leaves the drawing unchanged.
191
+
192
+
- ``sepia()``:
193
+
A CSS <percentage>. Converts the drawing to sepia. A value of 100% means completely sepia. A value of 0% leaves the drawing unchanged.
0 commit comments