Closed regexident closed 4 years ago
Merging #55 into master will increase coverage by
0.19%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #55 +/- ##
==========================================
+ Coverage 93.04% 93.24% +0.19%
==========================================
Files 14 14
Lines 374 385 +11
==========================================
+ Hits 348 359 +11
Misses 26 26
Flag | Coverage Δ | |
---|---|---|
#ios | 93.24% <100%> (+0.19%) |
:arrow_up: |
#osx | 5.97% <0%> (-0.18%) |
:arrow_down: |
Impacted Files | Coverage Δ | |
---|---|---|
Sources/Utils.swift | 100% <ø> (ø) |
:arrow_up: |
Sources/DynamicColor+RGBA.swift | 100% <100%> (ø) |
:arrow_up: |
Sources/DynamicColor+Deriving.swift | 100% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 1e85f94...5c7d732. Read the comment docs.
Looks good to me, thanks!
The current implementation of
final func grayscaled() -> DynamicColor
uses the HSL lightness as as measurement of lightness.While this is computationally convenient it does not provide a good match for the human perception of lightness.
Relative luminance (the
Y
inXYZ
) provides a much more accurate measure.This PR adds support for specifying which color space (i.e. xyz, hsl, rgb, hsv) to be used for grayscaling, defaulting to
.lightness
(aka HSL) for the sake of not introducing a breaking-change.⚠️ Depends on https://github.com/yannickl/DynamicColor/pull/56