Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Shade into Lighten and Darken, and add *Assign variants #249

Merged
merged 1 commit into from
Jul 20, 2021

Conversation

Ogeon
Copy link
Owner

@Ogeon Ogeon commented Jul 19, 2021

I have split up Shade and given the traits more obvious names. I think the whole setup is nicer like this. Also added *Assign traits for them with implementations for [T].

Breaking Change

The Shade trait has been split up into Lighten and Darken, and Scalar is no longer implied to implement Float.

@github-actions
Copy link

Benchmark for 578507b

Click to view benchmark
Test PR Benchmark Master Benchmark %
Cie family/lab to lch 3.5±0.05µs 3.8±0.15µs -7.89%
Cie family/lab to xyz 950.6±19.37ns 919.5±24.09ns +3.38%
Cie family/lch to lab 2.5±0.03µs 2.6±0.32µs -3.85%
Cie family/linsrgb to xyz 3.8±0.10µs 3.7±0.12µs +2.70%
Cie family/xyz to lab 11.1±0.42µs 11.8±0.50µs -5.93%
Cie family/xyz to yxy 705.8±16.68ns 708.6±21.95ns -0.40%
Cie family/yxy to xyz 633.0±31.84ns 602.2±18.79ns +5.11%
Matrix functions/matrix_inverse 13.7±0.51ns 13.1±0.34ns +4.58%
Matrix functions/multiply_3x3 10.7±0.17ns 18.5±0.52ns -42.16%
Matrix functions/multiply_rgb_to_xyz 4.7±0.10ns 4.8±0.13ns -2.08%
Matrix functions/multiply_xyz 4.7±0.12ns 4.7±0.12ns 0.00%
Matrix functions/multiply_xyz_to_rgb 4.7±0.11ns 4.7±0.11ns 0.00%
Matrix functions/rgb_to_xyz_matrix 24.8±0.62ns 24.7±0.71ns +0.40%
Rgb family/hsl to hsv 766.9±18.38ns 761.8±19.73ns +0.67%
Rgb family/hsl to linear hsl 9.4±0.20µs 9.4±0.20µs 0.00%
Rgb family/hsl to rgb 2.5±0.05µs 2.5±0.06µs 0.00%
Rgb family/hsv to hsl 1126.3±23.68ns 1151.9±39.46ns -2.22%
Rgb family/hsv to hwb 265.4±6.21ns 265.9±6.36ns -0.19%
Rgb family/hsv to linear hsv 9.0±0.44µs 8.7±0.25µs +3.45%
Rgb family/hsv to rgb 2.4±0.06µs 2.4±0.06µs 0.00%
Rgb family/hwb to hsv 558.2±13.48ns 553.9±9.61ns +0.78%
Rgb family/hwb to linear hwb 10.8±0.21µs 10.9±0.25µs -0.92%
Rgb family/linear hsl to hsl 10.6±0.47µs 10.0±0.23µs +6.00%
Rgb family/linear hsv to hsv 9.6±0.41µs 9.7±0.18µs -1.03%
Rgb family/linear hwb to hwb 11.9±0.53µs 12.0±0.52µs -0.83%
Rgb family/linsrgb to rgb 4.6±0.11µs 4.6±0.11µs 0.00%
Rgb family/linsrgb_f32 to rgb_u8 6.4±0.49µs 6.2±0.14µs +3.23%
Rgb family/rgb to hsl 851.4±24.26ns 843.7±20.79ns +0.91%
Rgb family/rgb to hsv 644.8±18.37ns 656.9±15.84ns -1.84%
Rgb family/rgb to linsrgb 5.0±0.13µs 5.0±0.21µs 0.00%
Rgb family/rgb_u8 to linsrgb_f32 5.5±0.26µs 5.3±0.12µs +3.77%
Rgb family/xyz to linsrgb 8.9±0.29µs 8.9±0.19µs 0.00%

@Ogeon
Copy link
Owner Author

Ogeon commented Jul 20, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 20, 2021

Build succeeded:

@bors bors bot merged commit 0c3b53b into master Jul 20, 2021
@bors bors bot deleted the lighten_darken branch July 20, 2021 10:07
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.

1 participant