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
{{ message }}
Repository navigation
Commit eaf8d98
Browse filesBrowse the repository at this point in the historyBrowse files
Read the alpha of #rgba and #rrggbbaa, and clamp colour channels instead of wrapping them
`#f008` was read from the wrong digits and `#rrggbbaa` lost its alpha.
A channel outside its range was masked into a byte, so rgb(255.5, 0, 0)
drew black and rgb(300, 0, 0) dark red. Read both hex forms with their
alpha, let the background shorthand take an eight-digit colour, clamp
channels, alphas and hsl() saturation and lightness to their range, and
add rebeccapurple.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG-GRAVITYPDF.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,6 +126,10 @@ Bugfixes
126
126
* A percentage alpha, as in `rgba(255, 0, 0, 50%)`, gave an opacity above 1, which viewers draw opaque.
127
127
* A fourth argument to `rgb()` or `hsl()` is read as the alpha instead of being dropped.
128
128
*`border-color: rgb(255, 0, 0)` or `cmyk(0, 100, 0, 0)`, with spaces after the commas, drew black.
129
+
* Some colour values were read wrongly. [#552][#570]
130
+
*`#rgba` was read from the wrong digits: `#f008` drew `rgb(240, 8, 0)`. `#rrggbbaa` dropped its alpha. Both are now read with their alpha.
131
+
* A channel outside its range wrapped instead of being clamped: `rgb(255.5, 0, 0)` drew black and `rgb(300, 0, 0)` dark red. Channels, alphas, and `hsl()` saturation and lightness are now clamped, as CSS does.
132
+
*`rebeccapurple` was missing. mPDF's `violetred`, which is not a CSS colour, is kept.
129
133
* A percentage `width`, `min-width` or `max-width` on an image in a table cell was resolved against the block around the table, not the cell. In a 60mm cell, `max-width: 20%` came out as 36mm. [#223][#505]
130
134
* Balancing columns raised a warning and drew a block's closing background past the last column. [#475][#488]
131
135
* Inside `<columns>`, a block with an `rgba()` or `cmyka()` background was painted fully opaque. [#482][#498]
@@ -703,3 +707,4 @@ These changes do not change output.
<p class="caption">background: #f008, red at 53% opacity, across a block that is black on the left and white on the right: dark red on the left, pink on the right.</p>
44
+
<div class="halves"><div class="band" style="background: #f008"></div></div>
45
+
46
+
<p class="caption">background: #0000ff80, blue at 50% opacity: dark blue on the left, light blue on the right.</p>
47
+
<div class="halves"><div class="band" style="background: #0000ff80"></div></div>
48
+
49
+
<h2>Channels outside their range</h2>
50
+
<p class="caption">rgb(255.5, 0, 0) and rgb(300, -20, 0) are clamped to red. Both lines are red.</p>
51
+
<p class="text" style="color: rgb(255.5, 0, 0)">rgb(255.5, 0, 0) is red</p>
52
+
<p class="text" style="color: rgb(300, -20, 0)">rgb(300, -20, 0) is red</p>
53
+
54
+
<p class="caption">rgba(0, 0, 255, 1.5), an alpha above 1, is clamped to 1: opaque blue across both halves.</p>
0 commit comments