Closed adius closed 4 years ago
@ad-si So in which cases should it return Nothing
? lighten x white
and darken x black
? I thought the problem is rather, that Other
can't be lighten
ed. I agree that there probably should be no calls to error
, as there currently is, but that's a major change. That being said, I'm fine with changing this to lighten :: Float -> Color -> Maybe Color
or even lighten :: Float -> Color -> Either ColorError Color
with some new error type to be defined, but then the old behaviour should be preserved in a function unsafeLighten
.
We could also do that in steps, i.e. first add a safeLighten
function, then deprecate or rename the current lighten
.
PR welcome.
Stale issue message
or maybe it returns a tuple a la
(error, value)
What do you think?