Repository navigation
Release v1.1.0: correctness fixes, CIE L*a*b* & WCAG features, tests, and PyPI Trusted Publishing - #1
Merged
Merged
Conversation
…rusted Publishing Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
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.
Summary
Prepares Hued
1.1.0with a comprehensive bug-fix and color-science correctness pass, new zero-dependency capabilities, full inline type annotations (py.typed), a 151-testpytestsuite + multi-version CI, provenance badges, and an updated PyPI OIDC Trusted Publishing workflow (configured for a blank environment) with PEP 740 and SLSA v1.0 provenance attestations.Key Fixes
conversions.py): FixedTypeErrorcrashes on saturated colors such as(255, 0, 0)and(0, 255, 0)where tiny negative linear components producedcomplexnumbers before clamping. Updated forward/inverse math to exact IEC 61966-2-1 D65 for lossless sRGB round-trips.analysis.py): Fixed dead-codec > 0.04045check on unnormalized[0, 255]channels and replaced gamma2.2with the WCAG 2.1 / IEC 61966-2-1 sRGB transfer function.analysis.py): Fixedget_text_color_from_backgroundreturning"dark"on pure black/charcoal and"light"on yellow, cyan, lime, and silver; now always chooses whichever maximizes WCAG 2.1 contrast.analysis.py): Fixedcheck_color_qualitytautology (previously returnedTruefor all 16.7M RGB colors), added explicit AA/AAA pass flags and optionalbackground/min_contrast, and fixedsimulate_color_blindnesstruncation and linear achromatopsia weights so neutral grays stay exact.analysis.py,conversions.py): Fixedget_temperature(yellow, cyan, teal, near-grays),is_pastel(pure white/gray vs soft pastels),is_muted(pure black & variable shadowing), stricthex_to_rgb/rgb_to_hexvalidation +#RGBshorthand, lossless analyticalhsl_to_hsv/hsv_to_hsl, consistent range/type validation,[0, 360)hue wrapping, andround()instead ofint()inblend_colors.palettes.py): Fixedgenerate_monochromatic(shades=1)ZeroDivisionError, separated rectangulargenerate_tetradic(angle=60)fromgenerate_square(), supported dictionary palettes inpalette_to_hex(), fixedexport_palette()extension detection viaos.path.splitext, and removed unsolicited stdoutprint()s.colors.py): Removed scraped vandalism/citation markers, resolved 7 duplicate color names, normalized hex casing, preserved acronyms/apostrophes inget_color_by_name(), added all 21 missing W3C CSS Color Level 4 named colors + CSS-token matching (all 148 CSS names now resolve), and cached RGB/Lab* lookups at module level.pyproject.toml): Replaced broken{{VERSION_PLACEHOLDER}}setup.pywith modern PEP 621/639pyproject.toml(Python>=3.9).New Features
rgb_to_lab,lab_to_rgb,xyz_to_lab,lab_to_xyz, plushex/hsl/hsv/cmyk↔labhelpers.delta_e(..., method="cie2000" | "cie76")(tested against Sharma, Wu & Dalal 2005 vectors) andcheck_wcag_contrast.linear_to_rgb,invert_color,to_grayscale,adjust_lightness,adjust_saturation, andblend_colors(..., linear=True).ColorManager&ColorPalette: Perceptualclosest_color_name(..., space="lab" | "cie2000"),get_color_by_hex,search_colors,get_random_color,add_color,remove_color, multi-spacegenerate_gradient(..., space="rgb" | "linear" | "lab" | "hsl"), and.cssexport.hued/py.typed,hued.__version__,CHANGELOG.md,.github/workflows/ci.yml, SHA-pinned.github/workflows/build_and_publish.yml(OIDC Trusted Publishing with noenvironment, PEP 740 attestations, SLSA build provenance, and idempotent GitHub Release), and provenance badges inreadme.md.Release Checklist
Owner: Infinitode,Repository: Hued,Workflow: build_and_publish.yml,Environment:blank).main.1.1.0(orv1.1.0) on the mergedmaincommit.