css.land icon indicating copy to clipboard operation
css.land copied to clipboard

Export?

Open anitagraham opened this issue 4 years ago • 3 comments

Would it be possible to have a function which exports the saved colours?

I've taken a screenshot, but that seems the least useful. Happy to help (time, time, time)

anitagraham avatar Jul 20 '20 03:07 anitagraham

What kind of export format did you envision?

LeaVerou avatar Jul 20 '20 04:07 LeaVerou

So many choices!

While my first thought was SCSS/CSS, perhaps Json would be better.

Notes

  • easy to convert to sass/scss/css
  • readable by many tools including this one
  • easily extended to include other formats
  • I left the values as strings (not breaking them down to a more complex structure) so that values would be immediately usable
[
  {
    "name": "dark muted red",
    "lch": "lch(24.761% 33.195 36.216)",
    "rgb": "rgb(38.7% 15.56% 12.06%)",
    "p3": "color(display-p3 0.3586 0.1693 0.1331)",
    "rec2020": "color(rec2020 0.2947 0.1483 0.0719)"
  },
  {
    "name": "red",
    "lch": "lch(51.761% 91.195 36.216)",
    "rgb": "rgb(92.94% 12.16% 14.12%)",
    "p3": "color(display-p3 0.8538 0.2248 0.1948)",
    "rec2020": "color(rec2020 0.7489 0.2666 0.1588)"
  }
]

anitagraham avatar Jul 20 '20 07:07 anitagraham

Oh cool, import/export is actually built-in to Mavo so it's trivial to add, it's just a matter of styling!

LeaVerou avatar Jul 20 '20 20:07 LeaVerou