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

Đang mở
#169 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Lĩnh vực
backend

Hướng nghiên cứu

Read the discussion of issues #56, #148 and ColorTypes.jl#235, along with the FixedPointNumbers.jl#207 decision referenced here. The examples specify desired scaling return types, while the body says the Bool cases are planned for PR #153 and other cases for v0.10; check that work before choosing a remaining scope. Done means the agreed multiplication and division cases return the specified types.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

breaking

This is related to issue #56, #148, and https://github.com/JuliaGraphics/ColorTypes.jl/issues/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. https://github.com/JuliaMath/FixedPointNumbers.jl/pull/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 # This should return `RGB{Float32}` in the first place, but that is a orthogonal problem.
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.

Ngôn ngữ chính
Julia
Star
59
Fork
24
Merge trung bình
13 giờ 2 phút
Pull request đã merge (30 ngày)
15

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của JuliaGraphics/ColorVectorSpace.jl

Tất cả issue của JuliaGraphics/ColorVectorSpace.jl

Issue tương tự

Thêm issue về Julia

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.