zyedidia / SFML.jl

A binding of the game and multimedia library SFML for Julia
Other
93 stars 22 forks source link

Use clamp! instead of clamp in Color() #19

Closed ibadr closed 8 years ago

ibadr commented 8 years ago

Calling Color() with arguments outside the range 0:255 results in InexactError while converting to UInt8. This fix uses clamp! instead of clamp to avoid this.

ibadr commented 8 years ago

Apologies! I just noticed that clamp! only operates on arrays not scalars, hence Travis is failing with

ERROR: LoadError: LoadError: MethodError: `clamp!` has no method matching clamp!(::Int64, ::Int64, ::Int64)

I fix this in the next pull request