How to use the d3-color.color.name function in d3-color

To help you get started, we’ve selected a few d3-color 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 lineupjs / lineupjs / src / ui / dialogs / ColorPicker.ts View on Github external
}
  node.insertAdjacentHTML('beforeend', `<strong>Sequential Color</strong>`);
  {
    for (const colors of sequentialColors) {
      node.insertAdjacentHTML('beforeend', `<div class="lu-checkbox lu-color-gradient"><input value="${colors.name}" type="radio" name="color" id="${id}${colors.name}">
      <label style="${gradient(colors.apply, 9)}" for="${id}${colors.name}"></label>
    </div>`);
    }
    node.insertAdjacentHTML('beforeend', `<div class="lu-checkbox lu-color-gradient"><input value="solid" type="radio" name="color" id="${id}S">
      <label for="${id}S"><input list="${id}LW" name="interpolate0" type="color"><input list="${id}LW" name="interpolate1" type="color"></label>
    </div>`);
  }
  node.insertAdjacentHTML('beforeend', `<strong>Diverging Color</strong>`);
  {
    for (const colors of divergentColors) {
      node.insertAdjacentHTML('beforeend', `<div class="lu-checkbox lu-color-gradient"><input value="${color.name}" type="radio" name="color" id="${id}${color.name}">
      <label style="${gradient(colors.apply, 11)}" for="${id}${color.name}"></label>
    </div>`);
    }
    node.insertAdjacentHTML('beforeend', `<div class="lu-checkbox lu-color-gradient"><input value="solid" type="radio" name="color" id="${id}D">
      <label for="${id}D">
        <input list="${id}L" name="diverging-1" type="color">
        <input list="${id}LW" name="diverging0" type="color">
        <input list="${id}L" name="diverging1" type="color">
        </label>
    </div>`);
  }
}

d3-color

Color spaces! RGB, HSL, Cubehelix, Lab and HCL (Lch).

ISC
Latest version published 3 years ago

Package Health Score

74 / 100
Full package analysis