Skip to content

Conversation

@leburgel
Copy link
Member

@leburgel leburgel commented Jul 9, 2025

Sets up optional color inversion for images in the docs. Seems to work fine for both .png and .svg images, by including images through raw HTML and adding a color-invertible class:

```@raw html
<img src="path/to/image.svg" class="color-invertible"/>
```

That way images are not inverted by default, which seems appropriate for e.g. plots. This also allows for specifying the size by adding something like width="50%", so I think this is sufficient for our use cases.

Fixing the logos to only have one image file was a bit more tricky. In particular, the only way I managed to make the README logo invertible was to embed some custom css into an svg and then including the normal logo through base6464 encoding. A little shady, and if the logo changes this README logo would have to be manually updated. But I can't really see a way around this.

I was also planning on updating and adding some actual images, but I'm not sure when I'll get to that so it might be good to merge just the setup first.

Preview is here.

@codecov
Copy link

codecov bot commented Jul 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lkdvos lkdvos added the documentation Improvements or additions to documentation label Jul 10, 2025
@leburgel leburgel changed the title [WIP] Set up optional color inversion for docs images Set up optional color inversion for docs images Jul 10, 2025
@leburgel leburgel marked this pull request as ready for review July 10, 2025 07:06
@leburgel leburgel requested a review from lkdvos July 14, 2025 07:51
Copy link
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me. I like that it is optional, and that the required setup is pretty minimal.

@lkdvos lkdvos merged commit bac4fbd into master Jul 14, 2025
28 checks passed
@lkdvos lkdvos deleted the lb/color_invert branch July 14, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants