-
Notifications
You must be signed in to change notification settings - Fork 35
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
gamutmax(LCHab)
disagrees with the Colors.jl usage
#125
Comments
Another option is to remove support for ones without a clearly defined max/min? |
In the case of However, few types have a clearly defined max/min, because the range of color space and the color gamut are based on different concepts. BTW, I found this issue when I ran |
As mentioned above, I think that "color gamut" and julia> rand(RGBA)
RGBA{Float64}(0.4054196785489861,0.5812337734513682,0.4739237429262706,0.35592317884458446)
julia> rand(Lab)
Lab{Float64}(49.35707185830977,54.78932461097497,-80.6404236285697)
julia> rand(LabA)
ERROR: MethodError: no method matching gamutmax(::Type{LabA{Float64}}) Although it is necessary to discuss whether |
BTW, ColorTypes.jl/src/operations.jl Lines 18 to 19 in 9607b73
correct_gamut(c::YIQ{T}) where {T} = YIQ{T}(clamp(c.y, zero(T), one(T)),
clamp(c.i, convert(T,-0.5957), convert(T,0.5957)),
clamp(c.q, convert(T,-0.5226), convert(T,0.5226))) |
The max saturation of
LCHab
is defined as1
in ColorTypes.jl.ColorTypes.jl/src/operations.jl
Lines 16 to 17 in 0d5904e
However, in Colors.jl, the saturation comes from the
a
andb
ofLab
which are mostly in [-100,100].https://github.com/JuliaGraphics/Colors.jl/blob/657e265a4cccc9fc32584f7f3505611537bfc79d/src/conversions.jl#L575-L580
Therefore, for the sake of convenience,
100
(or128
) is better for the max saturation, though the actual gamut is not so simple. (See also: #84)The text was updated successfully, but these errors were encountered: