chugathon

Author Topic: Gravit Designer Palette  (Read 459 times)

Offline ajulien

  • Newbie
  • *
  • Posts: 1
  • Karma: +1/-0
Gravit Designer Palette
« on: September 11, 2018, 09:06:28 PM »
I use Gravit Designer (https://gravit.io/). It's a very cool (and free) vector design software.

Its palette format is a JSON file which later gets gzipped. I just made a template for Cyotek Palette Editor to generate this JSON format:

Code: [Select]
{%- for rgb in rgbcolors -%}{%- assign total = rgb.Index -%}{%- endfor -%}
{"@":"swatches","$":[{%- for rgb in rgbcolors -%}
  {"@":"swatch","_pt":"C#[{{rgb.R}},{{rgb.G}},{{rgb.B}}]"}{%- if rgb.Index < total -%},{%- endif -%}
{%- endfor -%}]}

Feel free to use this code if you want to. If Palette Editor had the option to generate the already gzipped file (with a .gvswatch extension) and UTF-8 encoded, it would be great.

« Last Edit: September 11, 2018, 09:10:28 PM by ajulien »

Offline Richard Moss

  • Cyotek Team
  • Administrator
  • Sr. Member
  • *****
  • Posts: 291
  • Karma: +17/-0
    • cyotek.com
Re: Gravit Designer Palette
« Reply #1 on: September 12, 2018, 06:09:00 PM »
Hello,

Welcome to the forums and thank you for posting that sample template. Pretty cool, and great to know that some users are finding it useful. About the only thing I'd suggest is you don't need the first line where you manually calculate the number of colours - there's a variable named count which has that information.

I hadn't heard of Gravit before (and I have a habit of being irrationally against Electron applications), but one of my goals with the Palette Editor is to support as many formats natively as possible so I will log an enhancement to add this format to the product.

Once again, many thanks for the template data!

Regards;
Richard Moss
« Last Edit: September 12, 2018, 06:17:37 PM by Richard Moss »

 

anything