10000 GitHub - gregfitz23/color-generator: Ruby gem to randomly generate distinct colors with consistent lightness and saturation
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gregfitz23/color-generator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby Color Generator

Dependency Status Code Climate

This gem randomly generates very distinct colors with consistent lightness and saturation.

If you are using these colors as background colors, consistent lightness lets you use the same foreground color for each. Consistent saturation lets you avoid mixing pastels with vibrant colors, etc.

Usage

require 'color-generator'

Generate colors using the HSL color representation:

generator = ColorGenerator.new saturation: 0.3, lightness: 0.75
color1 = generator.create
# => "cfd2ac"
color2 = generator.create
# => "cbacd2"

Generate colors using the HSV color representation:

generator = ColorGenerator.new saturation: 0.3, value: 1.0
color1 = generator.create
# => "f7b3ff"
color2 = generator.create
# => "b3ffe0"

Acknowledgements

Thanks to Martin Ankerl for his blog post which inspired this gem.

Bugs? Questions?

This gem's main repository is on GitHub: http://github.com/opennorth/color-generator, where your contributions, forks, bug reports, feature requests, and feedback are greatly welcomed.

Copyright (c) 2012 Open North Inc., released under the MIT license

About

Ruby gem to randomly generate distinct colors with consistent lightness and saturation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%
0