Skip to content

Render v6 explicit RGBA stroke colours - #51

Open
reyna-b wants to merge 1 commit into
ricklupton:mainfrom
reyna-b:fix-v6-explicit-rgba-rendering
Open

reyna-b wants to merge 1 commit into
ricklupton:mainfrom
reyna-b:fix-v6-explicit-rgba-rendering

Conversation

@reyna-b

@reyna-b reyna-b commented Jul 17, 2026

Copy link
Copy Markdown

Summary

Fix SVG/PDF rendering for reMarkable v6 explicit RGBA stroke colours parsed by rmscene as Line.color_rgba.

Previously, explicit RGBA tuples such as (48, 74, 224, 77) were emitted directly as CSS rgba(48, 74, 224, 77). CSS alpha is not an 8-bit channel, so those strokes render incorrectly. This patch separates colour and opacity:

  • stroke colour: rgb(r, g, b)
  • opacity: a / 255

It also avoids applying an extra hard-coded fade to v6 SHADER strokes because the file already carries opacity in color_rgba.

Verification

  • Added unit coverage for svg_rgb, svg_alpha, normal pen opacity, and shader opacity.
  • Ran tests in a clean checkout with the patch applied:
4 passed in 0.10s
  • Rendered a real Paper Pro v6 .rm sample containing shader colours and confirmed generated SVG now contains valid CSS like:
stroke:rgb(48, 74, 224); opacity:0.30196078431372547

instead of invalid 8-bit alpha in rgba(...).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant