MCPcopy Index your code
hub / github.com/apache/echarts / convertToColorString

Function convertToColorString

src/util/format.ts:302–313  ·  view source on GitHub ↗
(color: ZRColor, defaultColor?: ColorString)

Source from the content-addressed store, hash-verified

300 * @return Never be null/undefined.
301 */
302export function convertToColorString(color: ZRColor, defaultColor?: ColorString): ColorString {
303 defaultColor = defaultColor || 'transparent';
304 return zrUtil.isString(color)
305 ? color
306 : zrUtil.isObject(color)
307 ? (
308 (color as GradientObject).colorStops
309 && ((color as GradientObject).colorStops[0] || {}).color
310 || defaultColor
311 )
312 : defaultColor;
313}
314
315export {truncateText} from 'zrender/src/graphic/helper/parseText';
316

Callers 6

renderMethod · 0.90
assembleArrowFunction · 0.90
showMethod · 0.90
_showAxisTooltipMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…