Fixed toColor function returning NaN

Tested the 'toColor' function with 'ffffff00'.
The returned result (in r,g,b,a) was 1,NaN,1,257.
The correct result should obviously be 1,1,1,0.
The hex substring was being done incorrectly.
Merge pull request #89 from ryanmcnz/patch-1

Fixed toColor function returning NaN