Skip to content

https://colors.eva.design/ JSON export not longer working #113

@alexander-schranz

Description

@alexander-schranz

only the JPG works but the JSON export not longer appears: https://colors.eva.design

Workaround

Copy following script into the browser console:

var colors = [
  ...document.querySelectorAll('ec-color-shade div > span')
].map((item) => item.innerText);

var colorNames = ['primary', 'success', 'info', 'warning', 'danger'];
var shadeLevels = [100, 200, 300, 400, 500, 600, 700, 800, 900];

var result = {};

colorNames.forEach((colorName, i) => {
  const offset = i * 10;
  shadeLevels.forEach((shade, j) => {
    const hex = colors[offset + j];
    if (hex) {
      result[`color-${colorName}-${shade}`] = hex;
    }
  });
});

console.log(JSON.stringify(result, null, 4));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions