Skip to content

Conversation

@aafkegros
Copy link
Contributor

@aafkegros aafkegros commented Jul 5, 2025

As discussed in #96
This implementation makes the docs require all 4 cvd type datasets implemented (normal/full vision, protan, deutan and tritan at 100% severity), and converts colors before calculating perceptual lightness, RGB/HSV values.
Colors are clipped to correct RGB codes (no negative or >255 values allowed), which allow for easy checking of linearity and other features of colormaps for the different cvd types.

I added a radio button with icons at the top to try to fit within the style the docs had until now visually.

closes #96

aafkegros and others added 2 commits July 5, 2025 15:38
adds material icons for the ui
all cmaps now render all 4 selectable cvd types for the docs, making this take longer/be bigger.
@aafkegros
Copy link
Contributor Author

I found currently the plots only show up if you refresh the page, so i'll still look into that 😅

tlambert03 and others added 11 commits July 5, 2025 16:06
* wip

* remove no sync

* ci: update Python setup action and pre-commit hook versions; fix typo in ColorStops class

* fix rtd

* ignore w004

* upd
pyapp-kit#102)

Bumps [pyvista/setup-headless-display-action](https://github.com/pyvista/setup-headless-display-action) from 3 to 4.
- [Release notes](https://github.com/pyvista/setup-headless-display-action/releases)
- [Commits](pyvista/setup-headless-display-action@v3...v4)

---
updated-dependencies:
- dependency-name: pyvista/setup-headless-display-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@aafkegros
Copy link
Contributor Author

Okay i fixed the typing issues, rebased and it seems functional on my end:
Screenshot 2025-07-05 at 16 23 52

What do you think?
Also: should there be an explanation of this feature anywhere?

@codecov
Copy link

codecov bot commented Jul 5, 2025

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.49%. Comparing base (66da1b1) to head (17c73c9).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/cmap/_util.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #109      +/-   ##
==========================================
- Coverage   95.51%   95.49%   -0.03%     
==========================================
  Files         166      166              
  Lines        2165     2175      +10     
==========================================
+ Hits         2068     2077       +9     
- Misses         97       98       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@tlambert03
Copy link
Member

I think this is freaking awesome. Thank you!

I'm happy to hit merge as is. It's very nicely implemented too.

  • Also: should there be an explanation of this feature anywhere? I can indeed imagine maybe a little question icon right aligned next to the radio buttons that pops up a modal explaining how calculations were made, and what it's doing
  • I also find myself wanting (at least) the sine-ramp image just above the radio buttons to also update... but I know that requires more stuff on our end and it should come in a follow up PR

@tlambert03
Copy link
Member

pre-commit issues are on main too. Don't worry about them. Let me know if you want to do anything else in this PR if if it's ready for merge

@aafkegros
Copy link
Contributor Author

This is ready to merge i think!

I couldn't very quickly find a way to implement the question icon. This would indeed probably be the best way to implement this - other option is to just add some text to the index.md but this is a bit docs-specific and not about the library itself.
I might still tinker with it in the future, but also the explanation is not essential as it is fairly straightforward as this is the commonly accepted cvd simulation algorithm.

For the sine-ramp it makes sense yes, and i indeed didnt touch it because it seemed like too much hassle, and because i personally also mostly care about the perceptual lightness 😊

@tlambert03
Copy link
Member

Absolutely.

Thanks again for your efforts on this! Much appreciated, great addition.

@tlambert03 tlambert03 merged commit af9c925 into pyapp-kit:main Jul 5, 2025
24 checks passed
@kevinyamauchi
Copy link
Contributor

Wow, seriously cool. Nice work @oanegros !

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.

Add colorblindness modes to docs?

3 participants