How to use the @grafana/ui.getTagColorsFromName function in @grafana/ui

To help you get started, we’ve selected a few @grafana/ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / core / components / TagFilter / TagBadge.tsx View on Github external
render() {
    const { label, removeIcon, count } = this.props;
    const { color, borderColor } = getTagColorsFromName(label);
    const tagStyle = {
      backgroundColor: color,
      borderColor: borderColor,
    };
    const countLabel = count !== 0 &amp;&amp; <span>{`(${count})`}</span>;

    return (
      <span style="{tagStyle}">
        {removeIcon &amp;&amp; <i>}
        {label} {countLabel}
      </i></span><i>
    );
  }
}</i>
github grafana / grafana / public / app / features / admin / AdminListUsersCtrl.ts View on Github external
function getAuthLabelStyle(label: string) {
  if (label === 'LDAP' || !label) {
    return {};
  }

  const { color, borderColor } = getTagColorsFromName(label);
  return {
    'background-color': color,
    'border-color': borderColor,
  };
}
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / features / admin / AdminListUsersCtrl.ts View on Github external
function getAuthLabelStyle(label: string) {
  if (label === 'LDAP' || !label) {
    return {};
  }

  const { color, borderColor } = getTagColorsFromName(label);
  return {
    'background-color': color,
    'border-color': borderColor,
  };
}
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / core / directives / tags.ts View on Github external
function setColor(name: string, element: JQuery) {
  const { color, borderColor } = getTagColorsFromName(name);
  element.css('background-color', color);
  element.css('border-color', borderColor);
}