fish-shell / fish-shell/fish-shell

Add color viewing convenience?

Open
#8,848 6 comments 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
34.2k
Forks
2.4k
Avg merge
2d 8h
Merged PRs (30d)
13

Description

Recently, when choosing various colors for stuff, I've wanted a better way to display and compare colors. I created a simple script/function for this:

```fish
function swatch
set -l height_in_lines 2

set -l width_in_chars (math --scale=0 $height_in_lines x 2.5) # 2.5 = ratio

for i in (seq $height_in_lines)
for arg in $argv
set_color -b $arg
string repeat --no-newline --count $width_in_chars ' '
set_color normal
end
echo
end
end
```

It looks like this:

![image](https://user-images.githubusercontent.com/6318351/161392664-45f54619-6fff-40a0-8e20-ea06b98ea3fc.png)

I was wondering if Fish might be interested in adding something like this. Perhaps as a subcommand to `fish_config`, perhaps as an option to `set_color`, e.g. `set_color --swatch`?

I think this is a pretty useful tool for interacting with `set_color` 😄

I'd also be happy to implement this, as it shouldn't be too difficult in C++ or Fish :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.