Is any way to print DataFrames using heat maps as background?

Thank you again for our (futile) struggle!

As bonus two color schemes. :slight_smile:

csSolarizedDivergent = ColorScheme([Colors.RGB(0xdc322f), Colors.RGB(0xfdf6e3), Colors.RGB(0x859900)])
    
csSolarizedMono = ColorScheme([Colors.RGB(0x002b36), Colors.RGB(0x657b83), Colors.RGB(0xfdf6e3)])
1 Like

Because Iā€™m seeing those green ticks with the timing indicator next to this, is this actually Jupyter notebook in VSCode rather than the terminal in VSCode?

1 Like

Iā€™m a newby and clueless. What I understend is the code that has the ā€œm\e[ā€ insted of ā€œ;ā€ works correctly both in console and VSCode.Jupyter

println("\e[38;2;255;255;0;48;2;0;0;255mThis must have blue background\e[0m")
println("\e[38;2;255;255;0m\e[48;2;0;0;255mThis must have blue background\e[0m")

however in Chrome.Jupyter and console it works OK

Hi,
I am looking for a documentation that explain the syntax

println("\e[

used in this post.
Thanks :slight_smile:

2 Likes

I wrote some utilities to encapsulate the setting of foreground and background colors for consoles. Tested on Win10.

module CS
u2c(v)::UInt8 = round(clamp(v, 0, 1) * 255)
c2s(RGB) = "$(u2c(RGB.r));$(u2c(RGB.g));$(u2c(RGB.b))"

fc(c::RGB) = "\e[38;2;$(c2s(c))m" #set foreground color
bc(c::RGB) = "\e[48;2;$(c2s(c))m" #set background color
fc(c) = "\e[38;5;$(clamp(c,0,255))m" #set foreground color
bc(c) = "\e[48;5;$(clamp(c,0,255))m" #set background color
fb0() = "\e[0m" #reset foreground and background color
end

for v in 0:15 print("$(CS.fc(16-v))$(CS.bc(v))*") end; println(CS.fb0())
for v in 0:15 print("$(CS.fc(v))*") end; println(CS.fb0())
for v in 0:15 print("$(CS.bc(v))*") end; println(CS.fb0())
for v in 0:1/16:0.99 print("$(CS.fc(RGB(v,v,0)))$(CS.bc(RGB(0,v,0)))*") end; println(CS.fb0())
for v in 0:1/16:0.99 print("$(CS.fc(RGB(v,v,0)))*") end; println(CS.fb0())
for v in 0:1/16:0.99 print("$(CS.bc(RGB(0,v,0)))*") end; println(CS.fb0())

image

5 Likes