Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure preview image background color via theme.toml #552

Merged

Conversation

benjajaja
Copy link
Contributor

benjajaja/ratatui-image#21

image
Due to ratatui's immediate-mode nature, the cells behind the image must be "skipped" so that nothing draws over the image. In other words, the cells behind the image still have whatever was drawn last time before they were marked skipped for the image. Thus, the image must always fill the cells/area, and the frame cannot be made transparent.

This PR makes the background color configurable via theme.toml. It could also be done via joshuto.toml, which is what I initially did, so I could revert to that. I am not sure which is better, the goal here is essentially to make previews look good in terminals with white background, but it actually also applies to any terminal theme background color that isn't pitch black.

Closes #521

@benjajaja benjajaja marked this pull request as draft July 20, 2024 08:53
@benjajaja benjajaja force-pushed the configure_image_background_color_theme branch from acb5e8c to 896fcd5 Compare July 20, 2024 09:01
@benjajaja benjajaja force-pushed the configure_image_background_color_theme branch from 896fcd5 to fb82b99 Compare July 20, 2024 09:04
@benjajaja benjajaja marked this pull request as ready for review July 20, 2024 09:06
Copy link
Owner

@kamiyaa kamiyaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@kamiyaa kamiyaa merged commit 297efaa into kamiyaa:main Aug 14, 2024
2 of 4 checks passed
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.

Configure ratatui-image preview background/frame color.
2 participants