Is there a way to compare 2 colors in JS, like 'If Color A is darker than #202020'
<p>The background color for one of my pages is set pulled from the background color the users set as their twitter background color.  I have a page that has a rounded box with a black border.  The border doesnt look good if the background color is dark, so i'd like to remove the border of the background is darker than an arbitrary hex color.  </p>

<p>The way I was thinking about doing this was using a regex to pull the 3 RGB values and summing them, and comparing that to my reference color.  Is there a better, way to accomplish this?</p>
