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

[RFC] Return type of scaling for non-parametric colors #169

Open
kimikage opened this issue May 3, 2021 · 1 comment
Open

[RFC] Return type of scaling for non-parametric colors #169

kimikage opened this issue May 3, 2021 · 1 comment

Comments

@kimikage
Copy link
Collaborator

kimikage commented May 3, 2021

This is related to issue #56, #148, and JuliaGraphics/ColorTypes.jl#235.

I think the following return types are reasonable and leave little room for debate.

julia> RGB24(1) * 1.0
RGB{Float64}(1.0,1.0,1.0)

julia> RGB24(1) / 1.0
RGB{Float64}(1.0,1.0,1.0)

julia> RGB24(1) / 1
RGB{Float32}(1.0f0,1.0f0,1.0f0)

The following is a bit controversial, but consistent with the decision in FixedPointNumbers (cf. JuliaMath/FixedPointNumbers.jl#207).

julia> RGB24(1) * 1
RGB{Float32}(1.0f0,1.0f0,1.0f0)

However, I think the following should return RGB24 objects.

julia> RGB24(1) * 1N0f8
RGB{N0f8}(1.0,1.0,1.0)

julia> RGB24(1) / 1N0f8
RGB{N0f8}(1.0,1.0,1.0)

julia> RGB24(1) * true
RGB{N0f8}(1.0,1.0,1.0)

I'm going to fix the obviously problematic cases regarding Bool in PR #153 and release it in v0.9.5. For other cases, I am planning to change them in v0.10 with new one.

@kimikage
Copy link
Collaborator Author

See also: #148 (comment)

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

No branches or pull requests

1 participant