sharkdp / pastel

A command-line tool to generate, analyze, convert and manipulate colors
Apache License 2.0
5k stars 97 forks source link

Restrict `amount` between `-1.0` and `1.0` for `pastel darken`, `pastel lighten`, `pastel (de)saturate` #74

Closed ghuls closed 4 years ago

ghuls commented 4 years ago

Restrict amount between -1.0 and 1.0 for pastel darken, pastel lighten, pastel (de)saturate, or add at least the range to the help.

sharkdp commented 4 years ago

Thank you for the feedback!

The help text already says:

Lighten a color by adding a certain amount to the HSL lightness channel (a number between 0.0 and 1.0). If the amount is negative, the color will be darkened.

Larger numbers will be clamped to the range [-1, 1]. This could be added to the help text.

What do you mean by restrict? Show an error for numbers outside the range? Would that really help here?

ghuls commented 4 years ago

My bad. I didn't see it, as I expected this info at the amount argument.

Like this (removed info from top description and moved to amount argument):

pastel darken --help
pastel-darken
Darken a color by subtracting a certain amount from the lightness channel.

USAGE:
    pastel darken <amount> [color]...

OPTIONS:
    -h, --help
            Prints help information

ARGS:
    <amount>
            amount of lightness to subtract (a number between 0.0 and
1.0). If the amount is negative, the color will be lightened

    <color>...
            Colors can be specified in many different formats, such as #RRGGBB, RRGGBB, #RGB,
            'rgb(…, …, …)', 'hsl(…, …, …)', 'gray(…)' or simply by the name of the color. The
            identifier '-' can be used to read a single color from standard input. Also, the special
            identifier 'pick' can be used to run an external color picker to choose a color. If no
            color argument is specified, colors will be read from standard input.
            Examples (all of these specify the same color):
              - lightslategray
              - '#778899'
              - 778899
              - 789
              - 'rgb(119, 136, 153)'
              - '119,136,153'
              - 'hsl(210, 14.3%, 53.3%)'
sharkdp commented 4 years ago

That sounds like a very good idea, thank you!