Hacker News new | ask | show | jobs
by Cogito 4874 days ago
This way the server can serve a static cached page, and distribute the work to derive the colour palette to the clients.

I agree that the server could do this, and for a small app like it is this wouldn't even be a big problem, however there is almost no impact on the end user and this way scaling is handled by 'better caching' and serving static pages faster.

Offloading to the client is a good thing in general, and I think there are few cases where it is possible but not the better option.

1 comments

The work to derive the palette? Do you mean RGB to HSL and back? That isn't particularly CPU-intensive.

One of many implementations: http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-mo...

I imagine you could precompute the entire 24 bit range if you really wanted.

I mean, this thing has a failure mode where it says it can't find your IP address. That makes no sense until you look at how it was implemented.