diegomura / diegomura/react-pdf

Page backgroundColor renders slightly off

Open
#2,018 1 comment 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

**Describe the bug**
As the title states, I believe this is an issue with colorspace `DeviceRGB` colors being rendered differently.

**To Reproduce**
Steps to reproduce the behavior including code snippet (if applies):
1. Set the page style:
```jsx
const styles = StyleSheet.create({
page: {
backgroundColor: '#64E0F6',
},
})
```
or
```jsx
const styles = StyleSheet.create({
page: {
backgroundColor: 'rgb(100, 224, 246)',
},
})
```
2. Add an image filled with the same color `#64E0F6`
3. There's a distinction when rendered.

_You can make use of [react-pdf REPL](https://react-pdf.org/repl) to share the snippet_

**Expected behavior**
The background color should match the image.

**Screenshots**
The page background is the top, the JPEG background is below.
According to the digital color meter, the top (`Page` `backgroundColor`) is `rgb(134, 221, 243)` while the bottom is `rgb(100, 224, 246)`
Screen Shot 2022-09-12 at 12 47 23 AM

**Desktop (please complete the following information):**
- OS: macOS
- Local
- React-pdf version: 3.0.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.