本文整理汇总了TypeScript中core/util/color.color2hex函数的典型用法代码示例。如果您正苦于以下问题:TypeScript color2hex函数的具体用法?TypeScript color2hex怎么用?TypeScript color2hex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了color2hex函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: _convert_color
export function _convert_color(color: string): number {
if (color[0] != "#")
color = color2hex(color)
if (color.length != 9)
color = color + 'ff'
return parseInt(color.slice(1), 16)
}
示例2: initialize
initialize(): void {
super.initialize();
this._nan_color = this._build_palette([color2hex(this.nan_color)])[0];
this._high_color = (this.high_color != null) ? this._build_palette([color2hex(this.high_color)])[0] : undefined;
this._low_color = (this.low_color != null) ? this._build_palette([color2hex(this.low_color)])[0] : undefined;
}