Closed EricRovell closed 3 years ago
Hi π In my opinion, since colord is 100% immutable (any action creates a new Colord
instance) it doesn't make a lot of sense to implement .copy()
method.
At the same time equals
sounds good and shouldn't cost us many bytes.
But I would go with color1.isEqual(color2)
or color1.isSame(color2)
for better consistency.
Yeah, it makes sense. I will try to implement it this way then :)
Just released v2.3.0. Thanks!
More color utilities
Summary
Add some more utility functions to work with color instances.
Motivation
Some more simple utilities may be useful for the user:
copy
orclone
: provides an easy way to clone a color instance.equals
: provides an easy way to compare two colors.Detailed design
The are two possibilities as I see:
As part of the interface
As utility functions
Discussion
I think it would be better for this utilities, if they are seems useful for you, to be part of the main interface. In any case, if you think this feature may be useful and should be implemented, I am ready to do this.