TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Adaptive Backgrounds – A jQuery plugin for extracting dominant colors

176 pointsby nsmalchover 11 years ago

13 comments

iamthepiemanover 11 years ago
I haven&#x27;t looked at the source in great detail yet so maybe you already have this feature.<p>It would be nice if you could specify an offset along the color wheel to select complimentary or analogous colors.<p>The default of selecting the dominant color removes all contrast between the image and the background which seems like a rarely desired behavior.
ronaldxover 11 years ago
Firstly, I like it. It&#x27;s an elegant solution that gives excellent results and works as it says.<p>Secondly, I don&#x27;t like it. In the general case, this is not something that should be left to the client to calculate - whenever you are serving the image, the server ought to know what the dominant colour is. Why make the client calculate this every time the image is displayed?<p>This is a case where JavaScript harms the user: a JavaScript&#x2F;jQuery solution to this has significant potential problems: there are numerous cases where it will break, some of which are identified in the other comments.
评论 #6906472 未加载
评论 #6906386 未加载
评论 #6907805 未加载
prezjordanover 11 years ago
Beware when you host assets directly from your GitHub source tree. They limit requests - I had to refresh a few times.<p>Throw a copy of your javascript in the actual gh-pages branch.
评论 #6906720 未加载
gprasanthover 11 years ago
This is one my favorite questions on StackOverflow: <a href="http://stackoverflow.com/q/13637892/1273830" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;q&#x2F;13637892&#x2F;1273830</a>
eliot_sykesover 11 years ago
RGBaster.js looks to be the underlying library used by the plugin to extract the colors, its written by the same developer (briangonzalez):<p><a href="https://github.com/briangonzalez/rgbaster.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;briangonzalez&#x2F;rgbaster.js</a>
评论 #6906800 未加载
nchapmanover 11 years ago
It seems like the problem with it not working very time is Github. I get a 503 on this URL every other time that I load it: <a href="http://rawgithub.com/briangonzalez/jquery.adaptive-backgrounds.js/master/src/jquery.adaptive-background.js" rel="nofollow">http:&#x2F;&#x2F;rawgithub.com&#x2F;briangonzalez&#x2F;jquery.adaptive-backgroun...</a>
评论 #6906143 未加载
Keyframeover 11 years ago
I don&#x27;t get it. Tried in several browsers and nothing happened.
评论 #6905817 未加载
评论 #6905815 未加载
K0nservover 11 years ago
It wasn&#x27;t working for me and I got the following error &quot;Uncaught IndexSizeError: Index or size was negative, or greater than the allowed value.&quot;. However it worked in incognito mode, I could reproduce the problem by enabling Disconnect in incognito mode. If you are having troubles try using incognito mode.
评论 #6905864 未加载
chensterover 11 years ago
Clever. How does it actually extract the dominant color? What kind of mathematics involved in this kind of stuff? From an architect point of view, does it make sense to do this on the client side?
评论 #6908384 未加载
wittekmover 11 years ago
This looks fantastic. I don&#x27;t think I&#x27;ll ever find a good use for it, but I may shoehorn it into something anyways. It&#x27;s really pretty!
deevusover 11 years ago
Like the example on the repo page, I think this could be really useful for images that are not the right size for its container.
coherentponyover 11 years ago
Just see some images. Not sure what I&#x27;m supposed to be looking at.
TallboyOneover 11 years ago
This is great and all .. but it doesn&#x27;t work in the latest chrome?
评论 #6905809 未加载
评论 #6905819 未加载
评论 #6906802 未加载