ded / morpheus

A Brilliant Animator
505 stars 57 forks source link

Fixed rgb to hex conversion function #3

Closed devongovett closed 13 years ago

devongovett commented 13 years ago

Probably don't want two #s, and switched to using slice instead of substr as suggested by @mathiasbynens (https://twitter.com/mathias/status/71829211794505728) because it is standard and saves a byte.

Btw, I don't know if you want to fix this, but it is a difference from your prior RGBtoHex function: negative components and components over 255 shouldn't be accepted. Didn't add this, but you could if you want! :-)