Skip to content

顺序方案

¥Sequential schemes

顺序配色方案可用作连续插值器(通常与 d3.scaleSequential 一起使用)和离散方案(通常与 d3.scaleOrdinal 一起使用)。

¥Sequential color schemes are available as continuous interpolators (often used with d3.scaleSequential) and as discrete schemes (often used with d3.scaleOrdinal).

每个离散方案(例如 d3.schemeBlues)都表示为一个由十六进制颜色字符串组成的数组。此数组的第 k 个元素包含大小为 k 的配色方案;例如,d3.schemeBlues[9] 包含一个由九个字符串组成的数组,代表蓝色顺序配色方案的九种颜色。顺序配色方案支持 k 的大小范围从 3 到 9。

¥Each discrete scheme, such as d3.schemeBlues, is represented as an array of arrays of hexadecimal color strings. The kth element of this array contains the color scheme of size k; for example, d3.schemeBlues[9] contains an array of nine strings representing the nine colors of the blue sequential color scheme. Sequential color schemes support a size k ranging from 3 to 9.

使用 蓝色 配色方案创建连续离散九色色阶:

¥To create a sequential discrete nine-color scale using the Blues color scheme:

js
const color = d3.scaleOrdinal(d3.schemeBlues[9]);

使用 蓝色 配色方案创建连续离散九色色阶:

¥To create a sequential continuous color scale using the Blues color scheme:

js
const color = d3.scaleSequential(d3.interpolateBlues);

interpolateBlues(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回“Blues”顺序配色方案对应的颜色,并以 RGB 字符串表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “Blues” sequential color scheme represented as an RGB string.

interpolateGreens(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回以 RGB 字符串表示的“Greens”顺序配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “Greens” sequential color scheme represented as an RGB string.

interpolateGreys(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回以 RGB 字符串表示的“Greys”顺序配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “Greys” sequential color scheme represented as an RGB string.

interpolateOranges(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回以 RGB 字符串表示的“Oranges”顺序配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “Oranges” sequential color scheme represented as an RGB string.

interpolatePurples(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回以 RGB 字符串表示的“Purples”顺序配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “Purples” sequential color scheme represented as an RGB string.

interpolateReds(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回以 RGB 字符串表示的“Reds”顺序配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “Reds” sequential color scheme represented as an RGB string.

interpolateTurbo(t)

源代码 · 给定一个 [0,1] 范围内的数值 t,返回 Anton Mikhailov 设计的“turbo”配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “turbo” color scheme by Anton Mikhailov.

interpolateViridis(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回由 van der Walt、Smith 和 Firing 为 matplotlib 设计的“viridis”感知均匀配色方案中对应的颜色,并以 RGB 字符串表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “viridis” perceptually-uniform color scheme designed by van der Walt, Smith and Firing for matplotlib, represented as an RGB string.

interpolateInferno(t)

源代码 · 给定一个 [0,1] 范围内的数值 t,返回由 van der Walt 和 Smith 为 matplotlib 设计的感知均匀配色方案“inferno”中对应的颜色,并以 RGB 字符串表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “inferno” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib, represented as an RGB string.

interpolateMagma(t)

源代码 · 给定一个 [0,1] 范围内的数值 t,返回 van der Walt 和 Smith 为 matplotlib 设计的“magma”感知均匀配色方案中对应的颜色,以 RGB 字符串表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “magma” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib, represented as an RGB string.

interpolatePlasma(t)

源代码 · 给定一个 [0,1] 范围内的数值 t,返回 van der Walt 和 Smith 为 matplotlib 设计的“plasma”感知均匀配色方案中对应的颜色,以 RGB 字符串表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “plasma” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib, represented as an RGB string.

interpolateCividis(t)

源代码 · 给定一个 [0,1] 范围内的数值 t,返回由 Nuñez、Anderton 和 Renslow 设计的针对色觉缺陷优化的“cividis”配色方案中对应的颜色,并以 RGB 字符串表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “cividis” color vision deficiency-optimized color scheme designed by Nuñez, Anderton, and Renslow, represented as an RGB string.

interpolateWarm(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回 Niccoli 感知彩虹 旋转 180° 后对应的颜色,并以 RGB 字符串表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from a 180° rotation of Niccoli’s perceptual rainbow, represented as an RGB string.

interpolateCool(t)

源代码 · 给定一个 [0,1] 范围内的数值 t,返回 Niccoli 感知彩虹 中对应的颜色,以 RGB 字符串的形式表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from Niccoli’s perceptual rainbow, represented as an RGB string.

interpolateCubehelixDefault(t)

源代码 · 给定一个 [0,1] 范围内的数值 t,返回 Green 默认的 Cubehelix 中对应的颜色,并以 RGB 字符串的形式表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from Green’s default Cubehelix represented as an RGB string.

interpolateBuGn(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回“BuGn”顺序配色方案对应的颜色,并以 RGB 字符串表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “BuGn” sequential color scheme represented as an RGB string.

interpolateBuPu(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回“BuPu”顺序配色方案对应的颜色,并以 RGB 字符串表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “BuPu” sequential color scheme represented as an RGB string.

interpolateGnBu(t)

源代码 · 给定一个介于 [0,1] 之间的数字 t,返回“GnBu”顺序配色方案中对应的颜色,以 RGB 字符串表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “GnBu” sequential color scheme represented as an RGB string.

interpolateOrRd(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回以 RGB 字符串表示的“OrRd”顺序配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “OrRd” sequential color scheme represented as an RGB string.

interpolatePuBuGn(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回以 RGB 字符串表示的“PuBuGn”顺序配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “PuBuGn” sequential color scheme represented as an RGB string.

interpolatePuBu(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回以 RGB 字符串表示的“PuBu”顺序配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “PuBu” sequential color scheme represented as an RGB string.

interpolatePuRd(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回以 RGB 字符串表示的“PuRd”顺序配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “PuRd” sequential color scheme represented as an RGB string.

interpolateRdPu(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回以 RGB 字符串表示的“RdPu”顺序配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “RdPu” sequential color scheme represented as an RGB string.

interpolateYlGnBu(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回以 RGB 字符串表示的“YlGnBu”顺序配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “YlGnBu” sequential color scheme represented as an RGB string.

interpolateYlGn(t)

源代码 · 给定一个 [0,1] 范围内的数字 t,返回以 RGB 字符串表示的“YlGn”顺序配色方案中对应的颜色。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “YlGn” sequential color scheme represented as an RGB string.

interpolateYlOrBr(t)

源代码 · 给定一个 [0,1] 范围内的数值 t,返回“YlOrBr”顺序配色方案中对应的颜色,并以 RGB 字符串表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “YlOrBr” sequential color scheme represented as an RGB string.

interpolateYlOrRd(t)

源代码 · 给定一个 [0,1] 范围内的数值 t,返回“YlOrRd”顺序配色方案中对应的颜色,并以 RGB 字符串表示。

¥Source · Given a number t in the range [0,1], returns the corresponding color from the “YlOrRd” sequential color scheme represented as an RGB string.

schemeBlues[k]

源代码 · 3-9 中大小为 k 的“蓝色”离散序列配色方案。

¥Source · The “Blues” discrete sequential color scheme of size k in 3–9.

schemeGreens[k]

源代码 · 3-9 中大小为 k 的“绿色”离散序列配色方案。

¥Source · The “Greens” discrete sequential color scheme of size k in 3–9.

schemeGreys[k]

源代码 · 3-9 中大小为 k 的“灰色”离散序列配色方案。

¥Source · The “Greys” discrete sequential color scheme of size k in 3–9.

schemeOranges[k]

源代码 · 3-9 中大小为 k 的“橙色”离散序列配色方案。

¥Source · The “Oranges” discrete sequential color scheme of size k in 3–9.

schemeP 紫色 [k]

¥schemePurples[k]

源代码 · 3-9 版中大小为 k 的“Purples”离散序列配色方案。

¥Source · The “Purples” discrete sequential color scheme of size k in 3–9.

schemeReds[k]

源代码 · 3-9 版中大小为 k 的“Reds”离散序列配色方案。

¥Source · The “Reds” discrete sequential color scheme of size k in 3–9.

schemeBuGn[k]

源代码 · 3-9 中大小为 k 的“BuGn”离散序列配色方案。

¥Source · The “BuGn” discrete sequential color scheme of size k in 3–9.

schemeBuPu[k]

源代码 · 3-9 中大小为 k 的“BuPu”离散序列配色方案。

¥Source · The “BuPu” discrete sequential color scheme of size k in 3–9.

schemeGnBu[k]

源代码 · 3-9 中大小为 k 的“GnBu”离散序列配色方案。

¥Source · The “GnBu” discrete sequential color scheme of size k in 3–9.

schemeOrRd[k]

源代码 · 3-9 中大小为 k 的“OrRd”离散序列配色方案。

¥Source · The “OrRd” discrete sequential color scheme of size k in 3–9.

schemePuBuGn[k]

源代码 · 3-9 中大小为 k 的“PuBuGn”离散序列配色方案。

¥Source · The “PuBuGn” discrete sequential color scheme of size k in 3–9.

schemePuBu[k]

源代码 · 3-9 中大小为 k 的“PuBu”离散序列配色方案。

¥Source · The “PuBu” discrete sequential color scheme of size k in 3–9.

schemePuRd[k]

源代码 · 3-9 版中大小为 k 的“PuRd”离散序列配色方案。

¥Source · The “PuRd” discrete sequential color scheme of size k in 3–9.

schemeRdPu[k]

源代码 · 3-9 版中大小为 k 的“RdPu”离散序列配色方案。

¥Source · The “RdPu” discrete sequential color scheme of size k in 3–9.

schemeYlGnBu[ k]

源代码 · 3-9 中大小为 k 的“YlGnBu”离散序列配色方案。

¥Source · The “YlGnBu” discrete sequential color scheme of size k in 3–9.

schemeYlGn[k]

源代码 · 3-9 中大小为 k 的“YlGn”离散序列配色方案。

¥Source · The “YlGn” discrete sequential color scheme of size k in 3–9.

schemeYlOrBr[k]

源代码 · 3-9 中大小为 k 的“YlOrBr”离散序列配色方案。

¥Source · The “YlOrBr” discrete sequential color scheme of size k in 3–9.

schemeYlOrRd[k]

源代码 · 3-9 中大小为 k 的“YlOrRd”离散序列配色方案。

¥Source · The “YlOrRd” discrete sequential color scheme of size k in 3–9.