Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ It's intended to be used as a demonstration of features and also to track the fi
| [session](session.svg) | simple terminal session running various commands like ls and cat |
| [444816](444816.svg) | Asciicast recording of an equilibrium pendulum to see compatibility with asciinema files |
| [444816 borderless](444816_borderless.svg) | Same as 444816 but without a terminal window |
| [rgb](rgb.svg) | Sample of rgb output |

> Files are not embedded here to alleviate loading

Expand All @@ -18,14 +19,14 @@ It's intended to be used as a demonstration of features and also to track the fi
This table tracks size changes between the first release of the example and the last one as examples are updated on each code change to reflect new features and optimizations.

<!--SIZES_START-->

| File | Iterations | First Size | Current Size | Variation |
| --------------------- | :--------: | ---------- | ------------ | --------- |
| 256colors.svg | 2 | 954.73KB | 950.15KB | .4800% |
| 444816.svg | 6 | 3.42MB | 2.92MB | 15.6300% |
| 444816_borderless.svg | 2 | 3.11MB | 2.92MB | 6.1700% |
| htop.svg | 4 | 74.15KB | 63.35KB | 15.7000% |
| session.svg | 5 | 462.64KB | 391.84KB | 16.5700% |
| File | Iterations | First Size | Current Size | Variation |
|------|:----------:|------------|--------------|-----------|
| 256colors.svg | 2 | 954.73KB | 950.15KB | .4800% |
| 444816.svg | 6 | 3.42MB | 2.92MB | 15.6300% |
| 444816_borderless.svg | 2 | 3.11MB | 2.92MB | 6.1700% |
| htop.svg | 4 | 74.15KB | 63.35KB | 15.7000% |
| rgb.svg | 0 | 93.29KB | 93.29KB | 0% |
| session.svg | 5 | 462.64KB | 391.84KB | 16.5700% |

<!--SIZES_END-->

Expand Down
56 changes: 56 additions & 0 deletions examples/rgb.cast
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{"version":2,"width":94,"height":33,"timestamp":1752315249,"duration":3.54579,"env":{"SHELL":"/bin/bash","TERM":"xterm-256color"}}
[0.246977,"o","\u001b[?2004h"]
[0.247113,"o","\u001b]0;alv_t@founder: ~/repos/go/termsvg\u0007\u001b[01;32malv_t@founder\u001b[00m:\u001b[01;34m~/repos/go/termsvg\u001b[00m$ "]
[0.50785,"o","."]
[0.691627,"o","/"]
[0.826325,"o","s"]
[1.20804,"o","c"]
[1.516782,"o","ripts/"]
[1.784562,"o","r"]
[2.023614,"o","gb_chart.sh "]
[2.370966,"o","\r\n\u001b[?2004l\r"]
[2.375934,"o","\u001b[38;2;0;0;0m██\u001b[0m\u001b[38;2;0;0;70m██\u001b[0m\u001b[38;2;0;0;140m██\u001b[0m\u001b[38;2;0;0;210m██\u001b[0m"]
[2.376964,"o","\u001b[38;2;0;70;0m██\u001b[0m\u001b[38;2;0;70;70m██\u001b[0m\u001b[38;2;0;70;140m██\u001b[0m"]
[2.377,"o","\u001b[38;2;0;70;210m██\u001b[0m"]
[2.378292,"o","\u001b[38;2;0;140;0m██\u001b[0m\u001b[38;2;0;140;70m██\u001b[0m"]
[2.378306,"o","\u001b[38;2;0;140;140m██\u001b[0m"]
[2.378363,"o","\u001b[38;2;0;140;210m██\u001b[0m"]
[2.3794,"o","\u001b[38;2;0;210;0m██\u001b[0m\u001b[38;2;0;210;70m██\u001b[0m"]
[2.379435,"o","\u001b[38;2;0;210;140m██\u001b[0m"]
[2.37948,"o","\u001b[38;2;0;210;210m██\u001b[0m"]
[2.381646,"o","\u001b[38;2;70;0;0m██\u001b[0m\u001b[38;2;70;0;70m██\u001b[0m"]
[2.381719,"o","\u001b[38;2;70;0;140m██\u001b[0m\u001b[38;2;70;0;210m██\u001b[0m"]
[2.382816,"o","\u001b[38;2;70;70;0m██\u001b[0m\u001b[38;2;70;70;70m██\u001b[0m"]
[2.382841,"o","\u001b[38;2;70;70;140m██\u001b[0m"]
[2.382899,"o","\u001b[38;2;70;70;210m██\u001b[0m"]
[2.383948,"o","\u001b[38;2;70;140;0m██\u001b[0m\u001b[38;2;70;140;70m██\u001b[0m\u001b[38;2;70;140;140m██\u001b[0m"]
[2.384027,"o","\u001b[38;2;70;140;210m██\u001b[0m"]
[2.385153,"o","\u001b[38;2;70;210;0m██\u001b[0m\u001b[38;2;70;210;70m██\u001b[0m"]
[2.385195,"o","\u001b[38;2;70;210;140m██\u001b[0m"]
[2.385228,"o","\u001b[38;2;70;210;210m██\u001b[0m"]
[2.387406,"o","\u001b[38;2;140;0;0m██\u001b[0m\u001b[38;2;140;0;70m██\u001b[0m"]
[2.387414,"o","\u001b[38;2;140;0;140m██\u001b[0m"]
[2.38749,"o","\u001b[38;2;140;0;210m██\u001b[0m"]
[2.388685,"o","\u001b[38;2;140;70;0m██\u001b[0m\u001b[38;2;140;70;70m██\u001b[0m"]
[2.388703,"o","\u001b[38;2;140;70;140m██\u001b[0m"]
[2.38878,"o","\u001b[38;2;140;70;210m██\u001b[0m"]
[2.389786,"o","\u001b[38;2;140;140;0m██\u001b[0m\u001b[38;2;140;140;70m██\u001b[0m"]
[2.389811,"o","\u001b[38;2;140;140;140m██\u001b[0m"]
[2.389863,"o","\u001b[38;2;140;140;210m██\u001b[0m"]
[2.391025,"o","\u001b[38;2;140;210;0m██\u001b[0m\u001b[38;2;140;210;70m██\u001b[0m"]
[2.391101,"o","\u001b[38;2;140;210;140m██\u001b[0m\u001b[38;2;140;210;210m██\u001b[0m"]
[2.393288,"o","\u001b[38;2;210;0;0m██\u001b[0m\u001b[38;2;210;0;70m██\u001b[0m"]
[2.393478,"o","\u001b[38;2;210;0;140m██\u001b[0m\u001b[38;2;210;0;210m██\u001b[0m"]
[2.394442,"o","\u001b[38;2;210;70;0m██\u001b[0m\u001b[38;2;210;70;70m██\u001b[0m"]
[2.394522,"o","\u001b[38;2;210;70;140m██\u001b[0m\u001b[38;2;210;70;210m██\u001b[0m"]
[2.395635,"o","\u001b[38;2;210;140;0m██\u001b[0m\u001b[38;2;210;140;70m██\u001b[0m"]
[2.395673,"o","\u001b[38;2;210;140;140m██\u001b[0m\u001b[38;2;210;140;210m██\u001b[0m"]
[2.396962,"o","\u001b[38;2;210;210;0m██\u001b[0m\u001b[38;2;210;210;70m██\u001b[0m\u001b[38;2;210;210;140m██\u001b[0m"]
[2.397039,"o","\u001b[38;2;210;210;210m██\u001b[0m\r\n"]
[2.415483,"o","\u001b[?2004h\u001b]0;alv_t@founder: ~/repos/go/termsvg\u0007\u001b[01;32malv_t@founder\u001b[00m:\u001b[01;34m~/repos/go/termsvg\u001b[00m$ "]
[2.718767,"o","e"]
[2.911637,"o","x"]
[3.095297,"o","i"]
[3.224075,"o","t"]
[3.545682,"o","\r\n\u001b[?2004l\r"]
[3.54579,"o","exit\r\n"]
1 change: 1 addition & 0 deletions examples/rgb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pkg/color/color.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func GetColor(c vt10x.Color) string {
return colors[int(vt10x.LightGrey)]
case c >= 1<<8:
rgb := intToRGB(uint32(c))
return fmt.Sprintf("#%02x%02x%02x", rgb.R, rgb.B, rgb.G)
return fmt.Sprintf("#%02x%02x%02x", rgb.R, rgb.G, rgb.B)
default:
return colors[int(c)]
}
Expand Down
Loading