Live data from Hacker News

Pastel: A command-line tool to generate, analyze, convert and manipulate colors

github.com

1–10 of 30 posts

Re: Pastel: A command-line tool to generate, analyze, convert and manipulate colors

#4

I was looking for a quick way to convert RGB 0-255 to RGB float 0.0-1.0 (often used in shaders and other areas of 3D programming) just the other day. This tool doesn't currently seem to support that, would be a nice addition.

Is it not sufficient to floating-point divide the input values by 255 ?

Edit: I guess that, even as simple as it would be to implement, it still is another useful output format

Re: Pastel: A command-line tool to generate, analyze, convert and manipulate colors

#5
post #2

I was just looking for something that could print hex color codes to the terminal the other day. The best solution I found was some hacky perl script which was hit-or-miss with certain colors, for some odd reason. Much appreciated.

Probably the perl script only supported 256 color modes, 24bit colors from the terminal are a relatively new item in terms of support in terminals.

Re: Pastel: A command-line tool to generate, analyze, convert and manipulate colors

#6

I was looking for a quick way to convert RGB 0-255 to RGB float 0.0-1.0 (often used in shaders and other areas of 3D programming) just the other day. This tool doesn't currently seem to support that, would be a nice addition.

Is it not sufficient to floating-point divide the input values by 255 ? Edit: I guess that, even as simple as it would be to implement, it still is another useful output format

[deleted]

Re: Pastel: A command-line tool to generate, analyze, convert and manipulate colors

#7

I was looking for a quick way to convert RGB 0-255 to RGB float 0.0-1.0 (often used in shaders and other areas of 3D programming) just the other day. This tool doesn't currently seem to support that, would be a nice addition.

Is it not sufficient to floating-point divide the input values by 255 ? Edit: I guess that, even as simple as it would be to implement, it still is another useful output format

Simple to implement yeah, hard for me to do in my head hence the need for a tool :-)

Re: Pastel: A command-line tool to generate, analyze, convert and manipulate colors

#8

Earlier quoted context omitted.

Is it not sufficient to floating-point divide the input values by 255 ? Edit: I guess that, even as simple as it would be to implement, it still is another useful output format

Simple to implement yeah, hard for me to do in my head hence the need for a tool :-)

$ command |sed 's/$/\/255/' | bc # or similar?

Re: Pastel: A command-line tool to generate, analyze, convert and manipulate colors

#9
I had to create some diagrams and needed a way to generate palettes programatically, this will come in handy since I can iterate over HSL space and convert back to RGB since the diagram tool only accepts RGB! If the OP is the author please send the info, let me pay you a beer ;)
Post reply on HN