title: Python CSS Parser
body: <p>I am experimenting with CSS files in Python to assist colour blind people. I need to get inside every selector block and change the 'background:' and 'color:'. I tried using CSS parsers like <code>tinycss</code> but they are not concentrating on getting selectors. </p>
  
  <p>Example input:</p>
  
  <pre class="lang-css prettyprint-override"><code>body {background:#fff; color:#ccc}
  </code></pre>
  
  <p>And output:</p>
  
  <pre class="lang-css prettyprint-override"><code>body {background:#000; color:#aaa}
  </code></pre>