ghcjs / diagrams-ghcjs

diagrams backend that renders directly to an HTML5 canvas
Other
23 stars 6 forks source link

Investigate colorToJSRGBA #5

Open co-dan opened 10 years ago

co-dan commented 10 years ago

https://github.com/ghcjs/diagrams-ghcjs/blob/master/src/Graphics/Rendering/GHCJS.hs#L157

16:45 #diagrams: < Martingale> notdan why did you write colorToJSRGBA for ghcjs instead of just using colorToSRGBA and multiplying the first 3 numbers by 255, from a quick read of the code it seems like they would have the same effect?

bergey commented 8 years ago

Mostly notes to myself on the status of this issue:

I agree that colorToJSRGBA is equivalent to what @jeffreyrosenbluth describes. I think from the IRC discussion that better inlining was the original motivation for moving this here. I suspect that since this commit the speed isn't much of an issue. But I'm not sure how to profile GHCJS programs, and I'd rather do that before making the change.