|
|
@ -1495,7 +1495,9 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu |
|
|
|
lappend rows $row |
|
|
|
lappend rows $row |
|
|
|
set row [list] |
|
|
|
set row [list] |
|
|
|
} |
|
|
|
} |
|
|
|
if {$i > 6} { |
|
|
|
if {$i == 8} { |
|
|
|
|
|
|
|
set fg "web-white" |
|
|
|
|
|
|
|
} elseif {$i > 6} { |
|
|
|
set fg "web-black" |
|
|
|
set fg "web-black" |
|
|
|
} |
|
|
|
} |
|
|
|
#lappend row "[a+ {*}$fg Term-$cname][format %3s $i] $cname " |
|
|
|
#lappend row "[a+ {*}$fg Term-$cname][format %3s $i] $cname " |
|
|
@ -1773,6 +1775,7 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu |
|
|
|
#$t configure_row [expr {[$t row_count]-1}] -ansibase [a+ $fg Rgb-$cdec] |
|
|
|
#$t configure_row [expr {[$t row_count]-1}] -ansibase [a+ $fg Rgb-$cdec] |
|
|
|
$t configure_row [expr {[$t row_count]-1}] -ansibase [a+ $fg Web-$cname] |
|
|
|
$t configure_row [expr {[$t row_count]-1}] -ansibase [a+ $fg Web-$cname] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$t configure -frametype {} |
|
|
|
$t configure_column 0 -headers [list "[string totitle $g] colours"] |
|
|
|
$t configure_column 0 -headers [list "[string totitle $g] colours"] |
|
|
|
$t configure_column 0 -header_colspans [list all] |
|
|
|
$t configure_column 0 -header_colspans [list all] |
|
|
|
$t configure -ansibase_header [a+ web-black Web-white] |
|
|
|
$t configure -ansibase_header [a+ web-black Web-white] |
|
|
@ -1787,9 +1790,21 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu |
|
|
|
$displaytable destroy |
|
|
|
$displaytable destroy |
|
|
|
return $result |
|
|
|
return $result |
|
|
|
} |
|
|
|
} |
|
|
|
proc colourtable_x11diff {} { |
|
|
|
proc colourtable_x11diff {args} { |
|
|
|
variable X11_colour_map_diff |
|
|
|
variable X11_colour_map_diff |
|
|
|
variable WEB_colour_map |
|
|
|
variable WEB_colour_map |
|
|
|
|
|
|
|
set defaults [dict create\ |
|
|
|
|
|
|
|
-return "string"\ |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
dict for {k v} $args { |
|
|
|
|
|
|
|
switch -- $k { |
|
|
|
|
|
|
|
-return {} |
|
|
|
|
|
|
|
default { |
|
|
|
|
|
|
|
error "colourtable_x11diff unrecognised option '$k'. Known options [dict keys $defaults]" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
set opts [dict merge $defaults $args] |
|
|
|
|
|
|
|
|
|
|
|
set comparetables [list] ;# 2 side by side x11 and web |
|
|
|
set comparetables [list] ;# 2 side by side x11 and web |
|
|
|
|
|
|
|
|
|
|
@ -1801,6 +1816,7 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu |
|
|
|
set fg "web-white" |
|
|
|
set fg "web-white" |
|
|
|
$t configure_row [expr {[$t row_count]-1}] -ansibase [a+ $fg X11-$cname] |
|
|
|
$t configure_row [expr {[$t row_count]-1}] -ansibase [a+ $fg X11-$cname] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$t configure -frametype block |
|
|
|
$t configure_column 0 -headers [list "X11"] |
|
|
|
$t configure_column 0 -headers [list "X11"] |
|
|
|
$t configure_column 0 -header_colspans [list all] |
|
|
|
$t configure_column 0 -header_colspans [list all] |
|
|
|
$t configure -ansibase_header [a+ web-black Web-white] |
|
|
|
$t configure -ansibase_header [a+ web-black Web-white] |
|
|
@ -1821,6 +1837,7 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu |
|
|
|
set fg "web-white" |
|
|
|
set fg "web-white" |
|
|
|
$t configure_row [expr {[$t row_count]-1}] -ansibase [a+ $fg Web-$cname] |
|
|
|
$t configure_row [expr {[$t row_count]-1}] -ansibase [a+ $fg Web-$cname] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$t configure -frametype block |
|
|
|
$t configure_column 0 -headers [list "Web"] |
|
|
|
$t configure_column 0 -headers [list "Web"] |
|
|
|
$t configure_column 0 -header_colspans [list all] |
|
|
|
$t configure_column 0 -header_colspans [list all] |
|
|
|
$t configure -ansibase_header [a+ web-black Web-white] |
|
|
|
$t configure -ansibase_header [a+ web-black Web-white] |
|
|
@ -1830,10 +1847,15 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu |
|
|
|
|
|
|
|
|
|
|
|
set displaytable [textblock::list_as_table 2 $comparetables -return object] |
|
|
|
set displaytable [textblock::list_as_table 2 $comparetables -return object] |
|
|
|
$displaytable configure -show_header 0 -show_vseps 0 |
|
|
|
$displaytable configure -show_header 0 -show_vseps 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {[dict get $opts -return] eq "string"} { |
|
|
|
set result [$displaytable print] |
|
|
|
set result [$displaytable print] |
|
|
|
$displaytable destroy |
|
|
|
$displaytable destroy |
|
|
|
return $result |
|
|
|
return $result |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $displaytable |
|
|
|
|
|
|
|
} |
|
|
|
proc a? {args} { |
|
|
|
proc a? {args} { |
|
|
|
#*** !doctools |
|
|
|
#*** !doctools |
|
|
|
#[call [fun a?] [opt {ansicode...}]] |
|
|
|
#[call [fun a?] [opt {ansicode...}]] |
|
|
@ -1947,7 +1969,7 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu |
|
|
|
} |
|
|
|
} |
|
|
|
x11 { |
|
|
|
x11 { |
|
|
|
set out "" |
|
|
|
set out "" |
|
|
|
append out "Mostly same as web - known differences displayed" \n |
|
|
|
append out " Mostly same as web - known differences displayed" \n |
|
|
|
append out [colourtable_x11diff] |
|
|
|
append out [colourtable_x11diff] |
|
|
|
return $out |
|
|
|
return $out |
|
|
|
} |
|
|
|
} |
|
|
@ -2141,9 +2163,10 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu |
|
|
|
#[para]punk::ansi::a Red |
|
|
|
#[para]punk::ansi::a Red |
|
|
|
#[para]see [cmd punk::ansi::a?] to display a list of codes |
|
|
|
#[para]see [cmd punk::ansi::a?] to display a list of codes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#function name part of cache-key because a and a+ return slightly different results (a has leading reset) |
|
|
|
variable sgr_cache |
|
|
|
variable sgr_cache |
|
|
|
if {[dict exists $sgr_cache $args]} { |
|
|
|
if {[dict exists $sgr_cache a+$args]} { |
|
|
|
return [dict get $sgr_cache $args] |
|
|
|
return [dict get $sgr_cache a+$args] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#don't disable ansi here. |
|
|
|
#don't disable ansi here. |
|
|
@ -2358,7 +2381,7 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
set result "\x1b\[[join $t {;}]m" |
|
|
|
set result "\x1b\[[join $t {;}]m" |
|
|
|
} |
|
|
|
} |
|
|
|
dict set sgr_cache $args $result |
|
|
|
dict set sgr_cache a+$args $result |
|
|
|
return $result |
|
|
|
return $result |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2373,9 +2396,10 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu |
|
|
|
#[para]punk::ansi::a Red |
|
|
|
#[para]punk::ansi::a Red |
|
|
|
#[para]see [cmd punk::ansi::a?] to display a list of codes |
|
|
|
#[para]see [cmd punk::ansi::a?] to display a list of codes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#It's important to put the functionname in the cache-key because a and a+ return slightly different results |
|
|
|
variable sgr_cache |
|
|
|
variable sgr_cache |
|
|
|
if {[dict exists $sgr_cache $args]} { |
|
|
|
if {[dict exists $sgr_cache a_$args]} { |
|
|
|
return [dict get $sgr_cache $args] |
|
|
|
return [dict get $sgr_cache a_$args] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#don't disable ansi here. |
|
|
|
#don't disable ansi here. |
|
|
@ -2589,7 +2613,7 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu |
|
|
|
# explicit reset at beginning of parameter list for a= (as opposed to a+) |
|
|
|
# explicit reset at beginning of parameter list for a= (as opposed to a+) |
|
|
|
set t [linsert $t[unset t] 0 0] |
|
|
|
set t [linsert $t[unset t] 0 0] |
|
|
|
set result "\x1b\[[join $t {;}]m" |
|
|
|
set result "\x1b\[[join $t {;}]m" |
|
|
|
dict set sgr_cache $args $result |
|
|
|
dict set sgr_cache a_$args $result |
|
|
|
return $result |
|
|
|
return $result |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -4762,7 +4786,7 @@ namespace eval punk::ansi::class { |
|
|
|
set displaycode [ansistring VIEW $code] |
|
|
|
set displaycode [ansistring VIEW $code] |
|
|
|
if {$col eq ""} { |
|
|
|
if {$col eq ""} { |
|
|
|
#row only move |
|
|
|
#row only move |
|
|
|
set map [list H "H${arrow_lr}" f "f${arrow_lr}] |
|
|
|
set map [list H "H${arrow_lr}" f "f${arrow_lr}"] |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
#row and col move |
|
|
|
#row and col move |
|
|
|
set map [list H "H${arrow_lr}${arrow_du}" f "${arrow_lr}${arrow_du}"] |
|
|
|
set map [list H "H${arrow_lr}${arrow_du}" f "${arrow_lr}${arrow_du}"] |
|
|
|