How to use the grommet-controls/utils.colorFromIndex function in grommet-controls

To help you get started, we’ve selected a few grommet-controls 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 atanasster / grommet-dashboard / components / npm / NPMStats.js View on Github external
);
    }
  } else {
    content = (
      
        {name}
        
      
    );
  }
  return (
    
      
        {content}
      
    
  );
};
github atanasster / grommet-dashboard / components / npm / PackageSelector.js View on Github external
tags = packages.map((p, i) =>
        ({
          label: ({p}),
          package: p,
          background: colorFromIndex(i),
        }));
    }
github atanasster / crypto-grommet / components / coins / MarketCapDistribution.js View on Github external
{(item) => {
            const smallCap = responsive || item.index > 4;
            return (
               this.onClickBackground(e, item)}
              >
github atanasster / crypto-grommet / components / equities / MarketCapDistribution.js View on Github external
{(item) => {
            const smallCap = responsive || item.index > 4;
            return (
               this.onClickBackground(e, item)}
              >
github atanasster / grommet-dashboard / pages / charts.js View on Github external
{[false, 'origin', 'start', 'end'].map((boundary, i) => (
github atanasster / grommet-dashboard / components / npm / Distribution.js View on Github external
packages.forEach((name, index) => {
        const npm = stats[name];
        if (npm && npm.evaluation) {
          result.push({
            name,
            value: parseInt(npm.evaluation.popularity[pName].toFixed(0), 10),
            color: theme.global.colors[colorFromIndex(index)],
          });
        }
      });
      return result.sort((a, b) => (b.value - a.value));