Created
January 9, 2018 21:03
-
-
Save bohdanszymanik/fc0babd6c7546320197fd3caf34ea50d to your computer and use it in GitHub Desktop.
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
// 12 step cold-hot colour scale from http://geog.uoregon.edu/datagraphics/color_scales.htm | |
let rowColourClass (x:double) (min:double) (max:double) = | |
let idx = | |
match x with | |
| x when x > max -> 0 | |
| x when x < min -> 12 | |
| _ -> (int)(Math.Round((x - min)/((max - min)/12.))) | |
[|"#002aff"; "#1965ff"; "#3299ff"; "#65ccff"; "#99edff"; "#ccffff"; "#ffffcc"; "#ffee99"; "#ffcc65"; "#ff9932"; "#ff6619"; "#ff2a00"|] | |
|> Array.rev | |
|> fun a -> a.[idx] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment