Skip to content

Commit

Permalink
Adds support for forcing console colors through an environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeraymonddowning committed Aug 25, 2021
1 parent 0c3c393 commit a17d0e9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ConsoleColor.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ public function removeTheme($name)
*/
public function isSupported()
{
// The COLLISION_FORCE_COLORS variable is for internal purposes only
if (getenv('COLLISION_FORCE_COLORS') !== false) {
return true;
}

if (DIRECTORY_SEPARATOR === '\\') {
return getenv('ANSICON') !== false || getenv('ConEmuANSI') === 'ON';
}
Expand Down

0 comments on commit a17d0e9

Please sign in to comment.