Skip to content

Commit c4bf2e6

Browse files
jaytaphfabpot
authored andcommitted
Added 'default' color
1 parent 5ec123f commit c4bf2e6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
2929
'magenta' => 35,
3030
'cyan' => 36,
3131
'white' => 37,
32+
'default' => 39,
3233
);
3334
private static $availableBackgroundColors = array(
3435
'black' => 40,
@@ -39,6 +40,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
3940
'magenta' => 45,
4041
'cyan' => 46,
4142
'white' => 47,
43+
'default' => 49,
4244
);
4345
private static $availableOptions = array(
4446
'bold' => 1,

src/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public function testForeground()
3737
$style->setForeground('blue');
3838
$this->assertEquals("\033[34mfoo\033[0m", $style->apply('foo'));
3939

40+
$style->setForeground('default');
41+
$this->assertEquals("\033[39mfoo\033[39m", $style->apply('foo'));
42+
4043
$this->setExpectedException('InvalidArgumentException');
4144
$style->setForeground('undefined-color');
4245
}
@@ -51,6 +54,9 @@ public function testBackground()
5154
$style->setBackground('yellow');
5255
$this->assertEquals("\033[43mfoo\033[0m", $style->apply('foo'));
5356

57+
$style->setBackground('default');
58+
$this->assertEquals("\033[49mfoo\033[49m", $style->apply('foo'));
59+
5460
$this->setExpectedException('InvalidArgumentException');
5561
$style->setBackground('undefined-color');
5662
}

0 commit comments

Comments
 (0)