Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add color scheme previews #1

Merged
merged 2 commits into from
Jan 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 41 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,49 +25,55 @@ The schemes are broken up into three categories based on the type of data you wa
All sequential color schemes can have between 3 and 9 colors (inclusive).
The available sequential color schemes are:

* Blues
* Oranges
* Greens
* Reds
* Purples
* Greys
* OrRd
* GnBu
* PuBu
* PuRd
* BuPu
* BuGn
* YlGn
* RdPu
* YlOrBr
* YlGnBu
* YlOrRd
* PuBuGn
| Name | Example |
|---------|------------------------------------|
| Blues | ![Blues](images/Blues.png "Blues") |
| Oranges | ![Oranges](images/Oranges.png "Oranges") |
| Greens | ![Greens](images/Greens.png "Greens") |
| Reds | ![Reds](images/Reds.png "Reds") |
| Purples | ![Purples](images/Purples.png "Purples") |
| Greys | ![Greys](images/Greys.png "Greys") |
| OrRd | ![OrRd](images/OrRd.png "OrRd") |
| GnBu | ![GnBu](images/GnBu.png "GnBu") |
| PuBu | ![PuBu](images/PuBu.png "PuBu") |
| PuRd | ![PuRd](images/PuRd.png "PuRd") |
| BuPu | ![BuPu](images/BuPu.png "BuPu") |
| BuGn | ![BuGn](images/BuGn.png "BuGn") |
| YlGn | ![YlGn](images/YlGn.png "YlGn") |
| RdPu | ![RdPu](images/RdPu.png "RdPu") |
| YlOrBr | ![YlOrBr](images/YlOrBr.png "YlOrBr") |
| YlGnBu | ![YlGnBu](images/YlGnBu.png "YlGnBu") |
| YlOrRd | ![YlOrRd](images/YlOrRd.png "YlOrRd") |
| PuBuGn | ![PuBuGn](images/PuBuGn.png "PuBuGn") |

All diverging color schemes can have between 3 and 11 colors (inclusive).
The available diverging color schemes are:

* Spectral
* RdYlGn
* RdBu
* PiYG
* PRGn
* RdYlBu
* BrBG
* RdGy
* PuOr
| Name | Example |
| -------- | ------------------------------------------- |
| Spectral | ![Spectral](images/Spectral.png "Spectral") |
| RdYlGn | ![RdYlGn](images/RdYlGn.png "RdYlGn") |
| RdBu | ![RdBu](images/RdBu.png "RdBu") |
| PiYG | ![PiYG](images/PiYG.png "PiYG") |
| PRGn | ![PRGn](images/PRGn.png "PRGn") |
| RdYlBu | ![RdYlBu](images/RdYlBu.png "RdYlBu") |
| BrBG | ![BrBG](images/BrBG.png "BrBG") |
| RdGy | ![RdGy](images/RdGy.png "RdGy") |
| PuOr | ![PuOr](images/PuOr.png "PuOr") |

The number of colors a qualitative color scheme can have depends on the scheme.
The available qualitative color schemes are:

* Set1
* Set2
* Set3
* Accent
* Dark2
* Paired
* Pastel1
* Pastel2
| Name | Example |
| ---- | ------------------------------- |
| Set1 | ![Set1](images/Set1.png "Set1") |
| Set2 | ![Set2](images/Set2.png "Set2") |
| Set3 | ![Set3](images/Set3.png "Set3") |
| Accent | ![Accent](images/Accent.png "Accent") |
| Dark2 | ![Dark2](images/Dark2.png "Dark2") |
| Paired | ![Paired](images/Paired.png "Paired") |
| Pastel1 | ![Pastel1](images/Pastel1.png "Pastel1") |
| Pastel2 | ![Pastel2](images/Pastel2.png "Pastel2") |

The `Paired` and `Set3` schemes can have between 3 and 12 colors (inclusive).
The `Pastel1` and `Set1` schemes can have between 3 and 9 colors (inclusive).
Expand Down
Binary file added images/Accent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Blues.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/BrBG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/BuGn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/BuPu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Dark2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions images/GenerateImages.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Color, ColorBrewer

function do_palette(name="Blues", size::Int=9)
width, height = "1cm", "0.5cm"
path = "$colorbrewer_git_path/images"
svg_filename = "$path/$name.svg"
png_filename = "$path/$name.png"
f = open(svg_filename, "w")
@printf f "%s\n" "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"$(size)cm\" height=\"0.5cm\">"
x = 0
for c in palette(name, size)
r, g, b = int(round(c.r*255)), int(round(c.g*255)), int(round(c.b*255))
@printf f "%s\n" "<rect x=\"$(x)cm\" width=\"$width\" height=\"$height\" fill=\"rgb($r, $g, $b)\"/>"
x += 1
end
@printf f "</svg>"
close(f)
run(`svg2png $svg_filename $png_filename`)
run(`rm $svg_filename`)
end

function main()
for name in ["Blues","Oranges","Greens","Reds","Purples","Greys","OrRd","GnBu","PuBu","PuRd","BuPu","BuGn","YlGn","RdPu","YlOrBr","YlGnBu","PuBuGn"]
do_palette(name, 9)
end
do_palette("YlOrRd", 8)
for name in ["Spectral","RdYlGn","RdBu","PiYG","PRGn","RdYlBu","BrBG","RdGy","PuOr"]
do_palette(name, 11)
end
do_palette("Set1", 9)
do_palette("Set2", 8)
do_palette("Set3", 12)
do_palette("Accent", 8)
do_palette("Dark2", 8)
do_palette("Paired", 12)
do_palette("Pastel1", 9)
do_palette("Pastel2", 8)
end

nothing
Binary file added images/GnBu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Greens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Greys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/OrRd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Oranges.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/PRGn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Paired.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Pastel1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Pastel2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/PiYG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/PuBu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/PuBuGn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/PuOr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/PuRd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Purples.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/RdBu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/RdGy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/RdPu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/RdYlBu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/RdYlGn.png
Binary file added images/Reds.png
Binary file added images/Set1.png
Binary file added images/Set2.png
Binary file added images/Set3.png
Binary file added images/Spectral.png
Binary file added images/YlGn.png
Binary file added images/YlGnBu.png
Binary file added images/YlOrBr.png
Binary file added images/YlOrRd.png