import React from 'react' import colors from './variable-colors.yaml' function convertHex(hex,opacity){ let r = parseInt(hex.substring(0,2), 16), g = parseInt(hex.substring(2,4), 16), b = parseInt(hex.substring(4,6), 16), result =`rgba(${r},${g},${b},${opacity})` return result } const Variable = ({variable: {variable, tags}, selectedTags, variableColors}) =>
  • {variable}

  • export default class Variables extends React.Component { render(){ let {variables, selectedTags} = this.props, variableSet = variables.reduce((set, {variable}) => set.add(variable), new Set()), // get unique variable names variableColors = [...variableSet].reduce((correspondance, v, i) => Object.assign(correspondance, {[v]: colors[i]}), {}) return } }