porescene.color.palette package

Submodules

Module contents

class porescene.color.palette.Colormap(*values)[source]

Bases: Enum

All colormaps bundled with porescene.

Each member’s value is the file name (without extension) of the corresponding colormap in porescene/data/colormap and can be passed to Palette.load(). The collection comprises

See porescene/data/colormap/README.txt for the per-collection provenance and licenses.

ACCENT = 'Accent'
Accent colormap
ACTON = 'acton'
acton colormap
ACTONS = 'actonS'
actonS colormap
ALGAE = 'algae'
algae colormap
AMP = 'amp'
amp colormap
BALANCE = 'balance'
balance colormap
BAM = 'bam'
bam colormap
BAMAKO = 'bamako'
bamako colormap
BAMAKOS = 'bamakoS'
bamakoS colormap
BAMO = 'bamO'
bamO colormap
BATLOW = 'batlow'
batlow colormap
BATLOWK = 'batlowK'
batlowK colormap
BATLOWKS = 'batlowKS'
batlowKS colormap
BATLOWS = 'batlowS'
batlowS colormap
BATLOWW = 'batlowW'
batlowW colormap
BATLOWWS = 'batlowWS'
batlowWS colormap
BERLIN = 'berlin'
berlin colormap
BGY = 'bgy'
bgy colormap
BGYW = 'bgyw'
bgyw colormap
BILBAO = 'bilbao'
bilbao colormap
BILBAOS = 'bilbaoS'
bilbaoS colormap
BJY = 'bjy'
bjy colormap
BKR = 'bkr'
bkr colormap
BKY = 'bky'
bky colormap
BLUES = 'Blues'
Blues colormap
BMW = 'bmw'
bmw colormap
BMY = 'bmy'
bmy colormap
BRBG = 'BrBG'
BrBG colormap
BROC = 'broc'
broc colormap
BROCO = 'brocO'
brocO colormap
BUDA = 'buda'
buda colormap
BUDAS = 'budaS'
budaS colormap
BUGN = 'BuGn'
BuGn colormap
BUKAVU = 'bukavu'
bukavu colormap
BUPU = 'BuPu'
BuPu colormap
BWY = 'bwy'
bwy colormap
CIVIDIS = 'cividis'
cividis colormap
COLORWHEEL = 'colorwheel'
colorwheel colormap
COOLWARM = 'coolwarm'
coolwarm colormap
CORK = 'cork'
cork colormap
CORKO = 'corkO'
corkO colormap
CUBEHELIX = 'cubehelix'
cubehelix colormap
CURL = 'curl'
curl colormap
CWR = 'cwr'
cwr colormap
DARK2 = 'Dark2'
Dark2 colormap
DAVOS = 'davos'
davos colormap
DAVOSS = 'davosS'
davosS colormap
DEEP = 'deep'
deep colormap
DELTA = 'delta'
delta colormap
DENSE = 'dense'
dense colormap
DEVON = 'devon'
devon colormap
DEVONS = 'devonS'
devonS colormap
DIFF = 'diff'
diff colormap
DIMGRAY = 'dimgray'
dimgray colormap
EMBER = 'ember'
ember colormap
FES = 'fes'
fes colormap
FIRE = 'fire'
fire colormap
GLASGOW = 'glasgow'
glasgow colormap
GLASGOWS = 'glasgowS'
glasgowS colormap
GNBU = 'GnBu'
GnBu colormap
GOULDIAN = 'gouldian'
gouldian colormap
GRAY = 'gray'
gray colormap
GRAYC = 'grayC'
grayC colormap
GRAYCS = 'grayCS'
grayCS colormap
GREENS = 'Greens'
Greens colormap
GREYS = 'Greys'
Greys colormap
GWV = 'gwv'
gwv colormap
HALINE = 'haline'
haline colormap
HAWAII = 'hawaii'
hawaii colormap
HAWAIIS = 'hawaiiS'
hawaiiS colormap
ICE = 'ice'
ice colormap
IMOLA = 'imola'
imola colormap
IMOLAS = 'imolaS'
imolaS colormap
INFERNO = 'inferno'
inferno colormap
ISOLUM = 'isolum'
isolum colormap
KB = 'kb'
kb colormap
KBC = 'kbc'
kbc colormap
KBGYW = 'kbgyw'
kbgyw colormap
KG = 'kg'
kg colormap
KGY = 'kgy'
kgy colormap
KR = 'kr'
kr colormap
LAJOLLA = 'lajolla'
lajolla colormap
LAJOLLAS = 'lajollaS'
lajollaS colormap
LAPAZ = 'lapaz'
lapaz colormap
LAPAZS = 'lapazS'
lapazS colormap
LIPARI = 'lipari'
lipari colormap
LIPARIS = 'lipariS'
lipariS colormap
LISBON = 'lisbon'
lisbon colormap
MAGMA = 'magma'
magma colormap
MANAGUA = 'managua'
managua colormap
MATTER = 'matter'
matter colormap
NAVIA = 'navia'
navia colormap
NAVIAS = 'naviaS'
naviaS colormap
NUUK = 'nuuk'
nuuk colormap
NUUKS = 'nuukS'
nuukS colormap
OLERON = 'oleron'
oleron colormap
ORANGES = 'Oranges'
Oranges colormap
ORRD = 'OrRd'
OrRd colormap
OSLO = 'oslo'
oslo colormap
OSLOS = 'osloS'
osloS colormap
OXY = 'oxy'
oxy colormap
PAIRED = 'Paired'
Paired colormap
PASTEL1 = 'Pastel1'
Pastel1 colormap
PASTEL2 = 'Pastel2'
Pastel2 colormap
PHASE = 'phase'
phase colormap
PIYG = 'PiYG'
PiYG colormap
PLASMA = 'plasma'
plasma colormap
PRGN = 'PRGn'
PRGn colormap
PUBU = 'PuBu'
PuBu colormap
PUBUGN = 'PuBuGn'
PuBuGn colormap
PUOR = 'PuOr'
PuOr colormap
PURD = 'PuRd'
PuRd colormap
PURPLES = 'Purples'
Purples colormap
RAIN = 'rain'
rain colormap
RAINBOW = 'rainbow'
rainbow colormap
RAINBOW4 = 'rainbow4'
rainbow4 colormap
RDBU = 'RdBu'
RdBu colormap
RDGY = 'RdGy'
RdGy colormap
RDPU = 'RdPu'
RdPu colormap
RDYLBU = 'RdYlBu'
RdYlBu colormap
RDYLGN = 'RdYlGn'
RdYlGn colormap
REDS = 'Reds'
Reds colormap
ROMA = 'roma'
roma colormap
ROMAO = 'romaO'
romaO colormap
SET1 = 'Set1'
Set1 colormap
SET2 = 'Set2'
Set2 colormap
SET3 = 'Set3'
Set3 colormap
SOLAR = 'solar'
solar colormap
SPECTRAL = 'Spectral'
Spectral colormap
SPEED = 'speed'
speed colormap
TAB10 = 'tab10'
tab10 colormap
TARN = 'tarn'
tarn colormap
TEMPO = 'tempo'
tempo colormap
THERMAL = 'thermal'
thermal colormap
TOFINO = 'tofino'
tofino colormap
TOKYO = 'tokyo'
tokyo colormap
TOKYOS = 'tokyoS'
tokyoS colormap
TOPO = 'topo'
topo colormap
TURBID = 'turbid'
turbid colormap
TURBO = 'turbo'
turbo colormap
TURKU = 'turku'
turku colormap
TURKUS = 'turkuS'
turkuS colormap
TWILIGHT = 'twilight'
twilight colormap
VANIMO = 'vanimo'
vanimo colormap
VIK = 'vik'
vik colormap
VIKO = 'vikO'
vikO colormap
VIRIDIS = 'viridis'
viridis colormap
YLGN = 'YlGn'
YlGn colormap
YLGNBU = 'YlGnBu'
YlGnBu colormap
YLORBR = 'YlOrBr'
YlOrBr colormap
YLORRD = 'YlOrRd'
YlOrRd colormap
class porescene.color.palette.Palette(colors)[source]

Bases: object

A basic wrapper for a collection of selected colors.

classmethod load(name)[source]

Creates a Palette instance by loading colormap data from file.

porescene includes a large set of scientific colormaps, including:

Parameters:

name (str | Colormap) – Colormap to be loaded from file, either as a Colormap member or the corresponding colormap name.

Return type:

Self

all()[source]

Returns the full color palette.

Return type:

list[Color]

first()[source]

Returns the first color of the palette.

Return type:

Color

last()[source]

Returns the last color of the palette.

Return type:

Color

random(n=1)[source]

Returns randomly selected colors from the palette.

Parameters:

n (int) – Number of colors to return, by default 1

Return type:

list[Color]

reversed()[source]

Returns the colors from the palette in reversed order.

Return type:

list[Color]

subset(n=5)[source]

Returns a subset of n equidistant sampled colors from the palette.

Parameters:

n (int) – Number of colors in the subset, by default 5

Return type:

list[Color]