Skip to content

Added matplolib color ramps: inferno, magma, plasma and viridis - #2053

Merged
lossyrob merged 2 commits into
locationtech:masterfrom
lossyrob:feature/color-ramps
Mar 13, 2017
Merged

lossyrob merged 2 commits into
locationtech:masterfrom
lossyrob:feature/color-ramps

Conversation

@lossyrob

@lossyrob lossyrob commented Mar 13, 2017 •

Copy link
Copy Markdown
Member

Fixes #1941

Also adds links to Carto Colors, so fixes #1944

Here are some example images from a Philadelphia elevation tile:

Magma

magma

Inferno

inferno

Plasma

plasma

Viridis

viridis

In case it proves useful later, I moved from the matplotlib 0.0-1.0 space and translated to the Scala source via:

def translate_colors(c):
    hexes = []
    for x in c:
        hexes.append(rgb2hex(x))
    scalad = list(map(lambda x: '0x' + (x.replace('#', '') + 'FF').upper(), hexes))
    N = 4
    grouped = [', '.join(scalad[n:n+N]) for n in range(0, len(scalad), N)]
    for group in grouped:
        print(group + ',')

@lossyrob lossyrob added this to the 1.1 milestone Mar 13, 2017
@lossyrob
lossyrob merged commit da20b06 into locationtech:master Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement new color ramps based on Carto Colors Implement Viridis, Magma, Plasma and Inferno color ramps from rstats package

1 participant