Sunday, 15 August 2010

browser - CSS Hex Code Expansion -


In CSS we can either use full 6 digit hex code for colors or we can use 3 digit shortcuts You can.

How does a browser go about calculating 6 digit hex from 3 point shortcuts?

  FFF / | \ / || \ / || \ FFFFFF   

Simple consultation looks a little crude (and here's a very rare example)

  var shortHex = "FFF"; Var fullHex = shortHex [0] + shortHex [0] + [...]   

What are the two digit parts obtained from the calculation based on the numeric value of a digit?

How do you get a binary value from hex D to 1101 , with a binary value of a code from DD can do? 11011101 through calculation?

One way is to multiply each hex digit by 11 (hex) which gives you the result then D * 11 yields DD .

This raises the question: How is this done in a browser? Is this just a case of doubling each issue or do they use another equation?

Second, why this 3 digit system started? What was inspired by this decision?

Shortcodes take advantage of web color, which has used triple which always doubles. Shortcode color codes can be used only with prices that can be doubled. Therefore

  #fff> #ffffff # 909 & gt; # 990099    

No comments:

Post a Comment