How can I add color to drush output? I'm writing a drush command, and outputting the results in table format. Everything works fine, the command runs, the output is displayed where it should be. However, there is one column where I am putting "Ok", "Warning", "Error" and I would like to be able to add color to that (the way drush does for its own commands). Yet I have looked everywhere without success to find instructions about how to do it, and would welcome some pointers.
In Drush 8 you may access Symfony Console output object directly.

&lt;?php

/**
 * @file
 * Contains example drush command.
 */

use Symfony\Component\Console\Output\ConsoleOutput;

/**
 * Implements hook_drush_command().
 */
function MODULENAME_drush_command() {
  $items['example'] = [
    'description' =&gt; 'Command description.',
  ];
  return $items;
}

/**
 * Callback function for example command.
 *
 * @see http://symfony.com/doc/current/console/coloring.html#using-color-styles
 */
function drush_MODULENAME_example() {
  $output = new ConsoleOutput();
  $output-&gt;writeln('&lt;info&gt;Green text&lt;/info&gt;');
  $output-&gt;writeln('&lt;comment&gt;Yellow text&lt;/comment&gt;');
  $output-&gt;writeln('&lt;question&gt;Black text on a cyan background&lt;/question&gt;');
  $output-&gt;writeln('&lt;error&gt;White text on a red background&lt;/error&gt;');
}