title: How to set auto inverting color of text in TextView?
body: <p>For example, if the background was white, the text color would be black. If the BG was black, the text would be white. Blue BG, yellow text, etc.
  <strong>Update:</strong></p>
  
  <pre><code>// method in MyActivity class
  void changeBackgroundColor(int newColor) {
      activityLayout.setBackgroundColor(newColor);
      int invertingColor = ColorInvertor.invert(newColor);
      someTextView.setTextColor(invertingColor);
  }
  </code></pre>
  
  <p>If I call <code>activity.changeBackgroundColor(Color.WHITE)</code>, then <code>someTextView</code> has to change the text color to black, i.e. <code>ColorInvertor.invert(Color.WHITE) == Color.BLACK</code>, and <code>ColorInvertor.invert(Color.BLACK) == Color.WHITE</code> etc.</p>