You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to think of some way to make the component traits better. The current setup, where Component represents any kind of component and FloatComponent is the float a subset, isn't really how I would have preferred it today. They are basically already obsolete on release. 🤔
What I would like to have with current day's mindset is something more capability oriented than classification oriented. What I mean with that is that I want smaller and more composable traits for more or less orthogonal aspects. So far I think something like this is a good start:
A trait that represents any component that has the typical 0.0-1.0 or 0-MAX range. Those are for any homogeneous color space, where each component has the same scale and range (i.e. RGB, HSV, HSL, HWB, Luma, maybe XYZ, etc.).
A trait that represents, I guess, real numbers. I don't want to force them to be floats, specifically. What if you want fixed point numbers? Or something else? The point is that they are not integers, and that they have the range 0.0-1.0 when combined with the previous mentioned trait.
A trait for angles. I think it would be good to have the typical constants, such as full circle and half circle. Not 100% sure here.
Some color spaces have their own ranges that don't match up with any other spaces. I'm considering giving them a trait each, to get rid of some hard coded number constants. For example a specific LabComponent trait with ranges for luminosity and chroma axes. Same here, not 100% sure.
I hope the pattern I'm going for here is somewhat clear. I'm trying to have a trait for each context or set of ranges, rather than what the number data types are. And also not have them assume Copy and Float and so on. I think it was a mistake to make them pull in more than what's used.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have been trying to think of some way to make the component traits better. The current setup, where
Component
represents any kind of component andFloatComponent
is the float a subset, isn't really how I would have preferred it today. They are basically already obsolete on release. 🤔What I would like to have with current day's mindset is something more capability oriented than classification oriented. What I mean with that is that I want smaller and more composable traits for more or less orthogonal aspects. So far I think something like this is a good start:
LabComponent
trait with ranges for luminosity and chroma axes. Same here, not 100% sure.I hope the pattern I'm going for here is somewhat clear. I'm trying to have a trait for each context or set of ranges, rather than what the number data types are. And also not have them assume
Copy
andFloat
and so on. I think it was a mistake to make them pull in more than what's used.Beta Was this translation helpful? Give feedback.
All reactions