title: Merge colors using javascript
body: <p>Let say I have some element with background and foreground colors.<br>
  Let say there could be both colors specified in different formats (any that could be specified in style attribute) like background = 'white' or 'transparent', foreground = 'rgb(0, 0, 0)'.<br>
  What is simplest way to merge these colors using pure javascript to get result like rgb(128, 128, 128)?  </p>
  
  <p>Thanks.</p>