-
Notifications
You must be signed in to change notification settings - Fork 36
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
Removing eltype_ub
and renaming eltype_default
#257
Comments
The current rules in However, the difference between fixed-point and floating-point has essentially nothing to do with the color models. For example, the 32-bit fixed-point type Therefore, a rule based on I believe that Interestingly, even in the current implementation, the return value of Line 562 in 754a397
|
Now, before we get into the discussion of specific promotion rules, there is a decision to be made, i.e. the naming of When a user defines a new color type, the user will be allowed to control the behavior of the constructors by overloading the However, Note that there is no need to remove |
This is part of the discussion on the promotion rules for constructor argument types.
The parametric color types currently defined in ColorTypes can be divided into two groups.
T <: Fractional
, e.g.RGB
,Gray
,ARGB
,GrayA
T <: AbstractFloat
, e.g.HSV
,ALab
The difference between these two groups affects the type promotion of constructor arguments.
ColorTypes.jl/src/types.jl
Lines 561 to 570 in 754a397
For example:
However, I would like to relax the upper bound (cf. #131 (comment)). In that case,
eltype_ub
for parametric types will always returnReal
, and that makes no sense. Also, if we follow the current policy of promotion based on the upper bound, we will end up with the following problematic results:This means that we need to move away from the policy based on the upper bound. Then the private API
eltype_ub
is no longer needed.The text was updated successfully, but these errors were encountered: