1 |
|
2 | /*
|
3 | Terminal Kit
|
4 |
|
5 | Copyright (c) 2009 - 2020 Cédric Ronvel
|
6 |
|
7 | The MIT License (MIT)
|
8 |
|
9 | Permission is hereby granted, free of charge, to any person obtaining a copy
|
10 | of this software and associated documentation files (the "Software"), to deal
|
11 | in the Software without restriction, including without limitation the rights
|
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13 | copies of the Software, and to permit persons to whom the Software is
|
14 | furnished to do so, subject to the following conditions:
|
15 |
|
16 | The above copyright notice and this permission notice shall be included in all
|
17 | copies or substantial portions of the Software.
|
18 |
|
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
25 | SOFTWARE.
|
26 | */
|
27 |
|
28 | ;
|
29 |
|
30 |
|
31 |
|
32 | /* jshint unused:false */
|
33 |
|
34 |
|
35 | require( '../lib/termkit.js' ).getDetectedTerminal( function( error , term ) {
|
36 | /*
|
37 | var term = require( '../lib/termkit.js' ).terminal ;
|
38 | term( 'Terminal name: %s\n' , term.appName ) ;
|
39 | term( 'Terminal app ID: %s\n' , term.appId ) ;
|
40 | term( 'Generic terminal: %s\n' , term.generic ) ;
|
41 | term( 'Config file: %s\n' , term.termconfigFile ) ;
|
42 | //*/
|
43 |
|
44 | var i , r , g , b ;
|
45 |
|
46 |
|
47 | term.bold( '\n=== 24 bits colors 256 shades of gray test ===\n\n' ) ;
|
48 |
|
49 | for ( i = 0 ; i <= 255 ; i ++ ) { if ( ! ( i % 70 ) ) { term( '\n' ) ; } term.colorGrayscale( i , "*" ) ; } // jshint ignore:line
|
50 | term.styleReset( '\n' ) ;
|
51 | for ( i = 0 ; i <= 255 ; i ++ ) { if ( ! ( i % 70 ) ) { term( '\n' ) ; } term.bgColorGrayscale( i , " " ) ; } // jshint ignore:line
|
52 | term.styleReset( '\n' ) ;
|
53 |
|
54 |
|
55 |
|
56 | term.bold( '\n=== 24 bits colors 256 shades of green test ===\n\n' ) ;
|
57 |
|
58 | for ( i = 0 ; i <= 255 ; i ++ ) { if ( ! ( i % 70 ) ) { term( '\n' ) ; } term.colorRgb( 0 , i , 0 , "*" ) ; } // jshint ignore:line
|
59 | term.styleReset( '\n' ) ;
|
60 | for ( i = 0 ; i <= 255 ; i ++ ) { if ( ! ( i % 70 ) ) { term( '\n' ) ; } term.bgColorRgb( 0 , i , 0 , " " ) ; } // jshint ignore:line
|
61 | term.styleReset( '\n' ) ;
|
62 |
|
63 |
|
64 |
|
65 | term.bold( '\n=== 24 bits colors 256 shades of desatured magenta test ===\n\n' ) ;
|
66 |
|
67 | for ( i = 0 ; i <= 255 ; i ++ ) { if ( ! ( i % 70 ) ) { term( '\n' ) ; } term.colorRgb( i , Math.floor( i / 2 ) , i , "*" ) ; } // jshint ignore:line
|
68 | term.styleReset( '\n' ) ;
|
69 | for ( i = 0 ; i <= 255 ; i ++ ) { if ( ! ( i % 70 ) ) { term( '\n' ) ; } term.bgColorRgb( i , Math.floor( i / 2 ) , i , " " ) ; } // jshint ignore:line
|
70 | term.styleReset( '\n' ) ;
|
71 |
|
72 |
|
73 |
|
74 | // Reset before exiting...
|
75 |
|
76 | term.styleReset( '\n' ) ;
|
77 | term( 'Reset...\n' ) ;
|
78 |
|
79 | } ) ;
|
80 |
|