fish-shell / fish-shell/fish-shell
Add color viewing convenience?
- 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:

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
Assessment
This issue has not been assessed yet.