Experimenting with a rainbow color scale that is cylical but has better perceptual properties. The HCL rainbow has roughly-constant luminance, but is ugly. The cubehelix rainbow, inspired by Matteo Niccoli’s perceptual rainbow but extended to 360°, varies in brightness but is prettier.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* I, Brandon Martin-Anderson, release this into the public domain or whatever. */ | |
BufferedReader reader; | |
double ll, bb, rr, tt; | |
float A = 1000.0; | |
GlobalMercator proj = new GlobalMercator(); |
Here are the math-y bits, courtesy of @ch402:
// The math-y bits
var a2 = Math.atan2(source.y, source.x);
var angle = function(source, compare) {
var cross = source.x * compare.y - source.y * compare.x;
var sd = Math.sqrt(source.x * source.x + source.y * source.y);
var cd = Math.sqrt(compare.x * compare.x + compare.y * compare.y);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 | |
height: 500 | |
border: no |
Pre-reqs:
- Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
- On macOS:
- Install XCode from the Mac App Store (or install the XCode command line utils).
- Have homebrew installed
- On Linux: