How to use rgb2hex - 2 common examples

To help you get started, we’ve selected a few rgb2hex 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 OpusCapita / fsm-workflow / crud-editor / src / components / WorkflowGraph / WorkflowGraph.react.js View on Github external
if (finalStates.indexOf(name) !== -1) {
        type = 'FINAL_STATE';
        fillColor = finalStateColor;
      } else if (initialState === name) {
        type = 'INITIAL_STATE';
        fillColor = initialStateColor;
      } else {
        type = 'REGULAR_STATE';
        fillColor = regularStateColor;
      }

      let isSelected = selectedStates.indexOf(name) !== -1;

      // border color
      let color = isSelected ? rgb2hex(Color(fillColor).darken(0.3).rgb().string()).hex : 'transparent';

      // eslint-disable-next-line max-len
      let nodeStr = `node [shape = record fillcolor="${fillColor}" margin="0.2,0.1" color="${color}" fontname="Helvetica" style="rounded,filled", penwidth=6];`;

      return `${nodeStr} "${getStateLabel(state.name)}" [id="oc-fsm--graph__node----${encodeURIComponent(state.name)}"]`;
    }).join(' ');
  }
github heineiuo / react-native-animated-linear-gradient / index.js View on Github external
        colors={[color0, color1].map((c) => rgb2hex(c).hex)}
        start={gStart}

rgb2hex

lightweight rgb/rgba to hex parser

MIT
Latest version published 3 years ago

Package Health Score

62 / 100
Full package analysis

Popular rgb2hex functions