Ogeon / palette

A Rust library for linear color calculations and conversion
Apache License 2.0
749 stars 60 forks source link

Add macros for `rand` traits and tuple converison #362

Closed Ogeon closed 10 months ago

Ogeon commented 10 months ago

This should cover most of the remaining repetitive parts that aren't too specific for macros. I may also do a separate refactor pass to make the color source files follow the same structure.

The only observable change should be that Okhsv doesn't require any additional traits for converting from a tuple, compared to other radial types.

codecov[bot] commented 10 months ago

Codecov Report

Merging #362 (e377480) into master (a5afba8) will increase coverage by 1.21%. Report is 5 commits behind head on master. The diff coverage is 94.79%.

@@            Coverage Diff             @@
##           master     #362      +/-   ##
==========================================
+ Coverage   79.40%   80.62%   +1.21%     
==========================================
  Files         117      113       -4     
  Lines       19123    18502     -621     
  Branches    19123    18502     -621     
==========================================
- Hits        15185    14917     -268     
+ Misses       3652     3297     -355     
- Partials      286      288       +2     
Files Coverage Δ
palette/src/alpha/alpha.rs 64.91% <ø> (ø)
palette/src/hsl.rs 83.12% <ø> (+0.33%) :arrow_up:
palette/src/hsv.rs 82.71% <ø> (+0.45%) :arrow_up:
palette/src/hwb.rs 74.69% <ø> (-1.05%) :arrow_down:
palette/src/lab.rs 87.87% <100.00%> (+2.10%) :arrow_up:
palette/src/lch.rs 86.82% <100.00%> (+1.43%) :arrow_up:
palette/src/lchuv.rs 82.71% <100.00%> (+0.57%) :arrow_up:
palette/src/luma/luma.rs 73.28% <ø> (-0.28%) :arrow_down:
palette/src/luv.rs 86.13% <100.00%> (+1.70%) :arrow_up:
palette/src/macros/random.rs 100.00% <100.00%> (ø)
... and 14 more

... and 8 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codspeed-hq[bot] commented 10 months ago

CodSpeed Performance Report

Merging #362 will not alter performance

Comparing more_macros (e377480) with master (a5afba8)

Summary

✅ 45 untouched benchmarks

Ogeon commented 10 months ago

bors r+

bors[bot] commented 10 months ago

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here. For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.