質問

I was asked this questiin in an Interview.I know how to convert from RGB to Hex Value.But I am not sure what is the benefit of doing it.

役に立ちましたか?

解決

Answer here?

Hex values are easier to copy and paste from image editors, normally easier to remember as it's only 6 digits and can easily become more compact, e.g. #fff vs rgb(255,255,255)

他のヒント

It's a bit more compact, and I suppose that you can identify 'websafe' colors easily. i.e. anything that follows the format of #xxyyzz.

i prefer to use hex as these use less characters and are more difficult to remember. its best to use the shortest method especially if you plan on compressing your css. hex is more web friendly as well.

With RGB you can define also the transparency of a color.

(0.5) = 50% transparent color:rgba(255, 255, 255,0.5)

(1) = 100% transparency = not transparent color:rgb(255, 255, 255,0.5)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top