简体   繁体   English

从 alt.Scheme 获取颜色

[英]Get color(s) from an alt.Scheme

Is it possible to get the html colors from a (categorical) scheme?是否可以从(分类)方案中获取 html 颜色?
Or is it possible to directly use one specific color from a scheme, for example if you want to use category10 colors also in titles, marks ...?或者是否可以直接使用方案中的一种特定颜色,例如,如果您还想在标题、标记中使用 category10 颜色......?

Altair doesn't store any information about the content of its color palates; Altair 不存储有关其色觉内容的任何信息; all of this is handled by the renderer (ie the vega-lite.js code).所有这些都由渲染器处理(即 vega-lite.js 代码)。

The raw source for all the vega-lite color schemes is contained in this file: https://github.com/vega/vega/blob/02d79dddb2850a24abfe6a4ebaf8823548709bb5/packages/vega-scale/src/palettes.js#L66所有 vega-lite 配色方案的原始来源都包含在此文件中: https : //github.com/vega/vega/blob/02d79dddb2850a24abfe6a4ebaf8823548709bb5/packages/vega-scale/src/palettes.js#L66

It would in principle be possible to write a Python API around this to extract a particular color code, but I'm not aware that anyone has written that code.原则上可以围绕此编写 Python API 来提取特定的颜色代码,但我不知道是否有人编写了该代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM