-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
# Objective Fixes #7757 New function `Color::as_lcha` was added and `Color::as_lch_f32` changed name to `Color::as_lcha_f32`. ---- As a side note I did it as in every other Color function, that is I created very simillar code in `as_lcha` as was in `as_lcha_f32`. However it is totally possible to avoid this code duplication in LCHA and other color variants by doing something like : ``` pub fn as_lcha(self: &Color) -> Color { let (lightness, chroma, hue, alpha) = self.as_lcha_f32(); return Color::Lcha { lightness, chroma, hue, alpha }; } ``` This is maybe slightly less efficient but it avoids copy-pasting this huge match expression which is error prone. Anyways since it is my first commit here I wanted to be consistent with the rest of code but can refactor all variants in separate PR if somebody thinks it is good idea.
- Loading branch information
Showing
1 changed file
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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