Closed avp closed 10 years ago
or maybe a supplementary method since it's not really comparing a true equal
state? Maybe something like color.near()
?
That's a valid way to do it too, and I think it's probably cleaner. We could just make color.equals()
call color.near()
.
The
.equals()
method should be able to take an optional argument for a percentage error, for example:color.equals(color2, 0.1)
would check to see thatcolor2
was within 10% ofcolor
.