Skip to content

Commit

Permalink
Add comparisons for Gray. Fixes #178 (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Sep 8, 2014
1 parent 724f345 commit 3b3e39f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/colortypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ for CV in subtypes(AbstractGray)
isinf{T<:FloatingPoint}(c::$CV{T}) = isinf(c.val)
abs(c::$CV) = abs(c.val) # should this have a different name?
abs{T<:Ufixed}(c::$CV{T}) = float32(c.val) # should this have a different name?

(<)(c::$CV, r::Real) = c.val < r
(<)(r::Real, c::$CV) = r < c.val
(<)(a::$CV, b::AbstractGray) = a.val < b.val
end
end

Expand Down

0 comments on commit 3b3e39f

Please sign in to comment.