@@ -364,6 +364,55 @@ describe('WebGL Renderer Integration Tests', async () => {
364364 }
365365 } ) ;
366366
367+ itWebgl ( 'foreground 16-255 dim' , async ( ) => {
368+ let data = '' ;
369+ for ( let y = 0 ; y < 240 / 16 ; y ++ ) {
370+ for ( let x = 0 ; x < 16 ; x ++ ) {
371+ data += `\\x1b[2;38;5;${ 16 + y * 16 + x } m█\x1b[0m` ;
372+ }
373+ data += '\\r\\n' ;
374+ }
375+ await writeSync ( page , data ) ;
376+ for ( let y = 0 ; y < 240 / 16 ; y ++ ) {
377+ for ( let x = 0 ; x < 16 ; x ++ ) {
378+ const cssColor = COLORS_16_TO_255 [ y * 16 + x ] ;
379+ const r = parseInt ( cssColor . slice ( 1 , 3 ) , 16 ) ;
380+ const g = parseInt ( cssColor . slice ( 3 , 5 ) , 16 ) ;
381+ const b = parseInt ( cssColor . slice ( 5 , 7 ) , 16 ) ;
382+ // It's difficult to assert the exact color due to rounding, just ensure the color differs
383+ // to the regular color
384+ await pollFor ( page , async ( ) => {
385+ const c = await getCellColor ( x + 1 , y + 1 ) ;
386+ return (
387+ ( c [ 0 ] === 0 || c [ 0 ] !== r ) &&
388+ ( c [ 1 ] === 0 || c [ 1 ] !== g ) &&
389+ ( c [ 2 ] === 0 || c [ 2 ] !== b )
390+ ) ;
391+ } , true ) ;
392+ }
393+ }
394+ } ) ;
395+
396+ itWebgl ( 'background 16-255 dim' , async ( ) => {
397+ let data = '' ;
398+ for ( let y = 0 ; y < 240 / 16 ; y ++ ) {
399+ for ( let x = 0 ; x < 16 ; x ++ ) {
400+ data += `\\x1b[2;48;5;${ 16 + y * 16 + x } m \\x1b[0m` ;
401+ }
402+ data += '\\r\\n' ;
403+ }
404+ await writeSync ( page , data ) ;
405+ for ( let y = 0 ; y < 240 / 16 ; y ++ ) {
406+ for ( let x = 0 ; x < 16 ; x ++ ) {
407+ const cssColor = COLORS_16_TO_255 [ y * 16 + x ] ;
408+ const r = parseInt ( cssColor . slice ( 1 , 3 ) , 16 ) ;
409+ const g = parseInt ( cssColor . slice ( 3 , 5 ) , 16 ) ;
410+ const b = parseInt ( cssColor . slice ( 5 , 7 ) , 16 ) ;
411+ await pollFor ( page , ( ) => getCellColor ( x + 1 , y + 1 ) , [ r , g , b , 255 ] ) ;
412+ }
413+ }
414+ } ) ;
415+
367416 itWebgl ( 'foreground true color red' , async ( ) => {
368417 let data = '' ;
369418 for ( let y = 0 ; y < 16 ; y ++ ) {
0 commit comments