You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be really nice to be able to paint gradients directly with pastel. You have the ability to read from stdin a set of colors such as those generated by pastel. It would really be nice to be able to take that input stream and "paint" a text string using a modified version of the output.
For instance, tmux requires that the colors have the prefix "#[fg=" and suffix "]".
I created a modified bash script that generates the required formats to create a gradient in tmux but it would be much nicer to be able to do it directly with speedy pastel.
#!/bin/bash
color_from="$1"
color_to="$2"
text="$3"
length=${#text}
colors=$(pastel gradient -n "$length" "$color_from" "$color_to" -sLCh)
i=0
for color in $colors; do
echo -ne "#[fg=$(pastel format hex "$color")]${text:$i:1}"
i=$((i+1))
done
printf "\n"
Is there any guidance you can give for how you could see the syntax being ? I'm happy to work on a PR to make this work
The text was updated successfully, but these errors were encountered:
Thank you for your request. Being able to write Bash scripts like yours above is exactly what pastel was designed for. To be honest, I'm not convinced that this needs to be a builtin feature. Maybe with ANSI colors, but probably not with tmux-custom color codes.
Hi ,
It would be really nice to be able to paint gradients directly with pastel. You have the ability to read from stdin a set of colors such as those generated by pastel. It would really be nice to be able to take that input stream and "paint" a text string using a modified version of the output.
For instance, tmux requires that the colors have the prefix "#[fg=" and suffix "]".
I created a modified bash script that generates the required formats to create a gradient in tmux but it would be much nicer to be able to do it directly with speedy pastel.
Is there any guidance you can give for how you could see the syntax being ? I'm happy to work on a PR to make this work
The text was updated successfully, but these errors were encountered: