Skip to content

Commit bb5ed33

Browse files
committed
[css-paint-api] Specify when 'currentColor' is used on PRC2D it is opaque black.
Fixes w3c#133.
1 parent 649c443 commit bb5ed33

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

css-paint-api/Overview.bs

+15
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,21 @@ the <a>output bitmap</a> such that the user agent can subsequently draw onto a d
384384
correct resolution. This also allows user agents to re-use the same output of the <a>output
385385
bitmap</a> repeatably while the visual viewport is being zoomed for example.
386386

387+
Whenever <code>"currentColor"</code> is used as a color in the {{PaintRenderingContext2D}} API, it
388+
is treated as opaque black.
389+
390+
<div class=example>
391+
The code below will produce a solid black rectange.
392+
<pre class=lang-javascript>
393+
registerPaint('currentcolor', class {
394+
paint(ctx, size) {
395+
ctx.fillStyle = 'currentColor';
396+
ctx.fillRect(0, 0, size.width, size.height);
397+
}
398+
});
399+
</pre>
400+
</div>
401+
387402
<div algorithm>
388403
When the user agent is to <dfn>create a PaintRenderingContext2D object</dfn> for a given |width|,
389404
|height|, and |alpha|, it <em>must</em> run the following steps:

0 commit comments

Comments
 (0)