Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support 16-color set (per Anders Kaseorg).

Closes #106 github issue.
Closes #133 github issue.
Closes #131 github issue.
  • Loading branch information...
commit a67ae7b0f4024290d29a9d616b86e71b6918fde4 1 parent 774e50d
@keithw keithw authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/terminal/terminalframebuffer.cc
View
8 src/terminal/terminalframebuffer.cc
@@ -380,7 +380,7 @@ Renditions::Renditions( int s_background )
background_color( s_background )
{}
-/* This routine cannot be used to set a color beyond the 8-color set. */
+/* This routine cannot be used to set a color beyond the 16-color set. */
void Renditions::set_rendition( int num )
{
if ( num == 0 ) {
@@ -403,6 +403,12 @@ void Renditions::set_rendition( int num )
} else if ( (40 <= num) && (num <= 47) ) { /* background color in 8-color set */
background_color = num;
return;
+ } else if ( (90 <= num) && (num <= 97) ) { /* foreground color in 16-color set */
+ foreground_color = num - 90 + 38;
+ return;
+ } else if ( (100 <= num) && (num <= 107) ) { /* background color in 16-color set */
+ background_color = num - 100 + 48;
+ return;
}
switch ( num ) {
Please sign in to comment.
Something went wrong with that request. Please try again.