nu_scripts/themes/screenshots/unikitty-dark.png
NotTheDr01ds 9a12d8df39
Additional Theme Features (#925)
Changes to `make.nu`:

* Adds in missing shapes and types noted further down in this PR by
@fdncred
* Adds colors for types - Mostly matching the corresponding shape, but
with any attribute (e.g., bold) removed
* Changed `int` and `float` values to be distinct. In most themes, the
colors should be complementary.
* Changes `bool: false` and `hints` colors - They were hardcoded to
`dark_grey` and wouldn't show up on some themes. Now uses a theme color
that should correspond to a theme-appropriate grey in most cases.
* Alphabetizes shapes and types so that Previews are also sorted
properly
* Eliminated spurious newline when sourcing theme (from printing OSC
codes for terminal colors)
* Renamed `3024` theme to `3024r` since module names can't be an `int`

Changes to `theme preview small`:

* Remove extra vertical spacing that was caused by different-sized row
column content
* Logically group elements - Types, Conditionally computed (closures)
types, Shapes, and other Structure (e.g., header, row_index, foreground,
etc.)
* Displays foreground/background on one line for clarity

Result is a much more compact, but also more readable, table.

Comparison:

<details><summary>Before</summary>
<p>
<img
src="https://github.com/user-attachments/assets/2673855d-d20d-4e14-8029-255138f2ecc9"
/>
</p>
</details> 

<details><summary>After</summary>
<p>
<img
src="https://github.com/user-attachments/assets/c8824b7a-440d-4567-bd69-b2e1df358340"
/>
</p>
</details> 

* Also refactored a lot of the code to be more maintainable - Moves the
rendering off to separate functions.

Changes to `preview_generate_screenshots.nu`:

* Accepts the method for generating screenshots as an argument
* Additional generation method using asciinema, agg (asciinema to
animated gif), and ffmpeg (to convert the animated gif to a single-image
PNG)

Additional Notes:

- Some Lemnos themes use color values that are the same (or nearly the
same) as the background in places. These are "broken" themes and always
have been as some elements will simply not be visible.

- There's a longstanding (I believe) bug that special-cased `record` for
the *key* rather than the *value*. I've fixed it so that the *key* is
now handled properly (same as other types), but I haven't implemented
any changes for color values that use a record (e.g., `{ fg: "#80a1a1",
attr: "b" }`) as this would make the table less compact. I'll look at
doing this for the longer form `preview theme` later.

- Closures other than for `string`, `bool`, `date`, and `filesize` are
currently only displayed as a summary. There aren't any themes currently
that this impacts, but if you create one manually, the display results
were pretty bad. This is primarily due to bad indentation from
`config.nu` (and/or defaults). A proper `nu-indent` would help fix this,
or maybe we could just remove all whitespace and display any closure as
a one-liner.

I probably won't regenerate screenshots until we figure out what to do
about the "monotone" type colors.
2024-07-29 17:08:13 -05:00

208 KiB
1843x1238px