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 fc11cbb
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
@@ -141,6 +141,10 @@ Bugfixes
141
141
*`vw`, `vh`, `vmin`, `vmax`, `Q` and `ch` were read as pixels, `+5mm` and `1e+1mm` as 0, and `1,5mm` as 1mm. The units are now resolved against the page and the font size, the numbers are read, and `1,5mm` is dropped. [#552][#565]
142
142
*`line-height: 0` gave lines a normal height. Lines now have no height, as in a browser. A line height well below the font size, such as `0.5` or `1mm`, was stretched down to the baseline; it is now kept. A negative `line-height`, which shrank lines to odd heights, is now ignored. [#552][#567]
143
143
* The rule after an `@supports`, `@layer`, `@keyframes`, `@container` or other block at-rule was lost, and so were the rules inside `@supports` and `@layer`. The rule after `@charset`, `@namespace` or `@import` was lost too. `@supports` and `@layer` blocks are now unwrapped as `@media` blocks are, except `@supports not`, and other at-rules are removed whole. [#524][#566]
144
+
* Some colour values were read wrongly. [#552][#570]
145
+
*`#rgba` was read from the wrong digits: `#f008` drew `rgb(240, 8, 0)`. `#rrggbbaa` dropped its alpha. Both are now read with their alpha.
146
+
* 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.
147
+
*`rebeccapurple` was missing. mPDF's `violetred`, which is not a CSS colour, is kept.
144
148
* 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]
145
149
* An `@page :left` or `@page :right` rule was ignored unless the style sheet also had a plain `@page` rule. With one, the margins of a `:right` rule were applied to left pages too. [#555][#556]
146
150
* When a later `WriteHTML()` call turned the document right to left, the text on the page already started was set between the swapped side margins. That page now keeps its margins, and the swap starts with the next page. [#554][#558]
@@ -751,4 +755,5 @@ 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