title: How to check if two System.Drawing.Color structures represent the same color in 16 bit color depth?
body: <p>How can I check if two System.Drawing.Color structures represent the same color in 16 bit color depth (or generally based on the value of Screen.PrimaryScreen.BitsPerPixel)?</p>
  
  <p>Let's say I set Form.TransparencyKey to Value1 (of Color type), I want to check that when the user selects a new background color for the form (Value2), I don't set the entire form transparent.</p>
  
  <p>On 32bit color depth screens I simply compare the two values:</p>
  
  <p>if (Value1 == Value2)</p>
  
  <p>However, this does not work on 16bit color depth screens, as more Color values for the Value2 would represent the same actual 16bit color as Value1, as I found out the hard way.</p>