Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As Mr Lister just said, it is easy to automate the calculation with any programming language :</p> <ol> <li>Separate your two colors into their 3 color numbers for <a href="http://en.wikipedia.org/wiki/RGB_color_model" rel="noreferrer">Red, Green, Blue</a> : (r1,g1,b1) and (r2,g2,b2).<br/> <ul> <li>For example #15293E, #012549 become ("15", "29", "3E"), ("01", "25", "49") <br/> <br/></li> </ul></li> <li>Convert each color string into an integer, specifying explicitly that you are parsing a <a href="http://en.wikipedia.org/wiki/Hexadecimal" rel="noreferrer">hexadecimal-based</a> representation of a number. <ul> <li>For example ("15", "29", "3E") becomes (21, 41, 62)<br/> <br/></li> </ul></li> <li>Calculate the average (r',g',b') = ( (r1+r2)/2, (g1+g2)/2, (b1+b2)/2 ). <ul> <li>For example ( (21+1)/2, (41+37)/2, (62+73)/2) = (11, 39, 67)<br/> <br/></li> </ul></li> <li>Convert them again to strings , specifying explicitly that you are generating <strong>two-digit</strong> hexadecimal representations (pad with a zero when necessary). <ul> <li>For example (11, 39, 67) -> ("0B", "27", "43")<br/> <br/></li> </ul></li> <li>Concatenate a sharp character followed by the 3 strings <ul> <li>For example ("0B", "27", "43") -> <strong>"#0B2743"</strong><br/></li> </ul></li> </ol> <p><strong>Edit :</strong> Implementation is not "very easy" as I initially stated. I took the time to write the code in several languages <a href="http://www.programming-idioms.org/idiom/154/halfway-between-two-hex-color-codes" rel="noreferrer">on Programming-Idioms</a> .</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload