Conversation
Status UIs lean on colour (green ok / red error), but for the ~8% of men with a colour-vision deficiency those can be indistinguishable and nothing could check it. simulate_cvd maps RGB through a dichromat matrix (protan/deuter/tritan) at a severity; colors_collide reports whether two colours become confusable under it. Pure stdlib over RGB tuples, no deps.
…-batch Add cvd_simulate: simulate colour-vision deficiency and flag collisions
…olour set_of_marks draws each numbered label at a fixed offset, so on dense UIs the numbers pile up and a dark label on a dark element vanishes. place_labels does greedy non-overlap placement over a candidate ring, staying in bounds; label_color picks black/white by better WCAG contrast (reusing a11y_audit.contrast_ratio). Pure geometry, fully testable.
…-batch Add marks_layout: non-overlapping Set-of-Marks labels with readable colour
a11y_audit.contrast_ratio grades a known foreground/background pair, but a button or label on screen is a patch of pixels, not two known colours. dominant_pair splits sampled pixels at the mean luminance into the dominant text (minority) and background (majority); grade_contrast grades a pair against WCAG AA/AAA; region_contrast samples a region (injectable sampler) and grades it. Grade + split are pure, reuse contrast_ratio.
…-batch Add contrast_map: grade on-screen text contrast by sampling its colours
match_template correlates raw pixel intensities, so a light-mode template scores terribly against the same control in dark mode (polarity inverted). normalize_theme maps an image to a polarity-invariant single channel (sobel/laplacian gradient magnitude, identical for an image and its inverse) and match_theme normalizes both sides before locating via visual_match.match_template. cv2/numpy imported lazily.
…ize-batch Add theme_normalize: match a light-mode template in dark mode
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 137 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Release — ROUND-15 perception lane (part 1)
Four new headless features, each with a pure / injectable-seam core, full 5-layer wiring, headless tests, and EN/Zh docs. All merged to dev with CI green first try.
cvd_simulate(Add cvd_simulate: simulate colour-vision deficiency and flag collisions #442): simulate colour-vision deficiency (protan/deuter/tritan) +colors_collide— are two status colours confusable? Pure stdlib, no numpy/cv2.marks_layout(Add marks_layout: non-overlapping Set-of-Marks labels with readable colour #443):place_labelsgreedy non-overlap Set-of-Marks placement +label_colorcontrast-aware text colour (reusesa11y_audit.contrast_ratio). Pure.contrast_map(Add contrast_map: grade on-screen text contrast by sampling its colours #444):dominant_pair/grade_contrast/region_contrast— sample a region's pixels, split into fg/bg, grade WCAG legibility. Pure core + injectable sampler.theme_normalize(Add theme_normalize: match a light-mode template in dark mode #445):normalize_theme(polarity-invariant gradient image) +match_theme— match a light-mode template in dark mode. cv2 lazy.Package stays Qt-free; all logic unit-tested without the OS/screen via pure cores and injected seams.