Zachary Wang
Zachary Wang

Reputation: 73

css color and image color

I have a question. Are css color(#xxxxxx) and image color be same?

For example the css is

#div1 { 
    background-color: #cf5654;
}

#div2 {
    background-image: url('1.png');
}

and the images color is #cf5654. Will it be same in any screen?

Upvotes: 3

Views: 224

Answers (3)

Scott
Scott

Reputation: 21882

Will it be same in any screen?

No.

Images can contain color profiles, but they don't have to.

Not all browsers respect color profiles. And not all browsers are color managed.

Monitors can be properly calibrated or not.

On a properly color managed and calibrated system then the image should appear the same as the hex color. However, if a browser/system is not color managed, or poorly calibrated, then no, the image will most likely not be the same as the hex color. In fact, it is possible in some scenarios to have drastically differing appearances between the image and the hex.

Upvotes: 2

Maros Macko
Maros Macko

Reputation: 89

It depends on image compression, then image could have little border around "manually created png". But, generally, no. It will be same at any screen

Upvotes: 0

bboy
bboy

Reputation: 1408

good one, but you might have a separate case when talking about cross-browsing rendering HEX.

might be worth giving it a read here: http://css-tricks.com/color-rendering-difference-firefox-vs-safari/

so in this case, my answer is no.

Upvotes: 1

Related Questions