TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The inconsistencies in your site's color palette

63 点作者 beghbali将近 13 年前

15 条评论

notJim将近 13 年前
Our perception of color varies a lot based on context—size of the swatch, background color, surrounding colors, etc. It is unsurprising that even on sites with a seemingly-consistent color palette, you'd see a lot of variation. Colors that are "the same" will also vary based on how they're being used, e.g. I might use "the same" blue for a highlight as I do for a shadow, but if you look at the RGB values, they're totally different. The reason is that your brain is seeing a shadow, and separating the brightness component (reduced, since it's a shadow), from the color component. Man, isn't your brain incredible.<p>It would be interesting to take this script and make it so that it does some kind of clustering, or looks at different components of the color—for example, you could just count the hues. One might expect to see a lot variation in lightness, but relatively little in hue, for example. On the other hand, maybe it's not that scientific, and designers just grab a color picker and fiddle until it looks right.
noonat将近 13 年前
Although a site may have a primary color palette, colors will often look very different in context. Our vision is full of tricks and assumptions that can cause the same color value to look drastically different in different situations. The color in your swatch might look different when used on a different background color, or might not appear as bright when used as a link color, and so on. It's reasonable to expect some variation in the color palette to deal with these issues. Some of these counts seem a bit excessive, though.
评论 #4330560 未加载
评论 #4331397 未加载
评论 #4330532 未加载
evincarofautumn将近 13 年前
As a pixel artist, here’s my take on it:<p>You ought to choose a palette that is <i>as small as possible</i> while remaining versatile. Each entry should serve a distinct purpose, and should look different (and look good) next to various other entries.<p>For example: a mid-saturation, mid-lightness violet, say around #793D58, can be used as (1) a dark background for light elements, (2) a text or link colour on a light background, or (3) a shadow for bluish or reddish elements. Knowing how colours are perceived, and how to use them well, drastically reduces the size of a palette—the vast majority of pixel art uses fewer than 20 colours, and fewer than 10 is common.<p>In particular, there is usually no need to create ad-hoc colours for different contexts, such as with LESS colour transformations. These can be useful tools, but they can also create inconsistency because they take control out of your hands. And when it comes to design, I for one prefer not to leave things to chance.
tylerxprice将近 13 年前
Could some of the 'used once' colors just be a shading or bevel on an element of the main color? Rather than just someone picking a color that is 'close enough'.
babuskov将近 13 年前
It would be nice if results would be presented as colored boxes rather than color codes.
lazerwalker将近 13 年前
I'd bet part of why this happens on some of the more egregious 'offenders' (although it's arguable whether this is actually a problem or not) is the use of CSS preprocessors. It's a lot easier for a designer to add in one-off slight variations to a color when you have something like Compass or LESS's color manipulation functions.
评论 #4331353 未加载
geon将近 13 年前
If a site use css gradients with carefully tuned values -say, for glass buttons- they will easily "use" 5-10 colors for each gradient.<p>It would still look like a solid color + gloss, caustics and shadow, so from a design point of view it might be fair to treat each gradient as one "color".
评论 #4331448 未加载
k3n将近 13 年前
How is it the site with one of the most conservative designs -- Github -- has by &#38; large the most colors? From memory, I only see a few shades of gray when I picture the site, though I know there's a few colors that accent the UI, but hell, 331 is more than the entire old "web safe palette".<p>I wonder if there's some sort of anomaly or bug causing the number to be so high... perhaps they use far less images, and instead use CSS instead? Maybe they have a CSS-based color-picker somewhere in their source?
评论 #4330463 未加载
评论 #4330992 未加载
评论 #4330471 未加载
bitsweet将近 13 年前
Main branding colors should be consistent - where unique colors will crop up is for things like borders, hover-states, text-shadows that will not necessarily work again in another context.<p>Coderwall also deliberately has a slightly different color palette for each area of the site so it's not a big surprise to see our colors quickly stack up to the 44 colors the article mentions.<p>It might be a little excessive to have &#62;100 colors like some of the sites mentioned.
ahoge将近 13 年前
This is often due to color profiles. You take a screenshot (or a mockup), grab the color, and use that value. If you didn't explicitly disable color management beforehand, you've created a new color.<p>Another reason are JPEGs. You get a mockup as JPEG and you use color values from that image.<p>I recommend to put a list of colors at the top of your primary style sheet. That's where others will look for it.
sudonim将近 13 年前
One thing I do is start with something like 5 base colors and then in my stylesheets (with SASS), I lighten or darken those colors.<p>Using this analysis it would appear that we're all over the place. But in reality there are subtle changes using lighten and darken in sass to address what notJim is talking about in his comment -- "perception of color varies on size, background color, surrounding colors".
rshm将近 13 年前
Script does not take care of images and image backgrounds.<p>You can use, <a href="http://cutycapt.sourceforge.net/" rel="nofollow">http://cutycapt.sourceforge.net/</a> to render the site into png, and analyze the pixels from it.
评论 #4330257 未加载
评论 #4331603 未加载
josephcooney将近 13 年前
I'm surprised the author chose to visualise this data the way they did. This is crying out for a stacked bar-graph, where each 'bar' is the colour in question, and the height of the bar is the frequency.
评论 #4332362 未加载
ecmendenhall将近 13 年前
Interesting. I understand the value of keeping design simple and CSS readable, but are there performance implications (page load times, &#38;c.) to using a large color palette?
评论 #4335828 未加载
asder1将近 13 年前
HN has a orange background as inline HTML..<p>so actually this software it's just to extract color palette from CSS files
评论 #4333817 未加载