Git Product home page Git Product logo

palgrad's Introduction

palgrad

Build Status Crates.io

Radial gradients and linear gradient

palgrad is a command line utility that creates color gradients and palettes from user input colors.

Gradients are created in Lch color space (also known as HCL), the cylindrical representaiton of the Lab or L*a*b* color space. Using this color space, gradients are generally more vibrant and visually appealing than other spaces like HSV or RGB.

Features

  • Radial and linear continuous gradients
  • Radial continuous gradients with overlay
  • Radial and linear stepped gradients
  • Declare colors in Lch, HSV, and RGB

Some ideas for using the output:

  • gamut masking
  • pixelization to make more color swatches
  • bring into digital painting programs to color pick from as limited palettes and apply more filters
  • website/application color themes

This crate uses palette to handle the heavy lifting of color conversion.

Examples

Overlay color on radial gradient

Radial gradients and linear gradien

palgrad -c -o -s 128

Overlay a 50% grey over the default RGB colors in -c with a size of 128x128 pixels. An overlay RGB color can be specified after the -o argument.

Stepped radial gradient

Radial gradients and linear gradien

palgrad --hsv -n 5 -s 128 -r 0.25

Use the default HSV colors --hsv, 5 steps between the colors, size of 128x128, and inner radius factor of -r 0.25.

Stepped linear gradient

Radial gradients and linear gradien

palgrad -l -d -n 8 --ss 30x20

Make a linear gradient -l with the default RGB decimal colors -d, 8 steps between the two colors, and the swatch sizes are 30x20 pixels each. To make a continuous gradient, omit the steps argument -n.

License

This crate is licensed under either

at your option.

palgrad's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

palgrad's Issues

Expose more settings to command line interface

  • - Angle offset: radial offset defaults to 90º (π/2) so first color is at top of circle. 0º would start at 3 o'clock or due east of center.
  • - Overlay factor: Blending mode for overlay is atop, and defaults to 0.9. 1.0 seemed to cover too much in one tone close to the center but would be good to expose to the user (almost done already).
  • - Output file: currently always takes timestamp and never takes the user supplied output.

Document all the functionality

  • Write some type of description about the command line arguments and usage, justification/explanation for values chose by default
  • Make an FAQ.md or more detailed readme to show usage. Images don't load on doc.rs

Project cleanup

  • - Completely rewrite arg parsing based on lessons learned from using structopt
  • - Update readme with new examples of radial stepped gradient
  • - Write document for functions in radial.rs and linear.rs

Specify a background color for jpg and png out

  • - Specify background color to composite the gradients over.
  • - (blocked on palette update and switching to crates version) Flag for WCAG version and only render colors that pass the contrast ratio between itself and the background. Probably good idea for linear too somehow, maybe have swatches only take up 80% of the specified swatch area and background color underneath.

Incorporate `rand` crate behind feature gate

Add rand to generate colors in ranges for

  • HSV [0.0-360.0, 0.0-1.0, 0.0-1.0]
  • Lch [0-100, 0-100, 0-360]
  • Rgb - [0-255; 3]
Implemented upstream

Ability to lock one or two of the parameters and generate random numbers for the other two.

  • what would the notation look like for that? (ie. Lch: [30,x,50 to 30,x,y])

Error handling

Add custom errors, error handling for unwraps and expects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.