Author Topic: Gravit Designer Palette  (Read 722 times)

Offline ajulien

  • Newbie
  • *
  • Posts: 2
  • 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: 315
  • 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 »

Offline ajulien

  • Newbie
  • *
  • Posts: 2
  • Karma: +1/-0
Re: Gravit Designer Palette
« Reply #2 on: May 16, 2019, 05:56:22 PM »
I had forgotten to reply to you. I tend to prefer native over Electron, certainly. But things like Gravit and VSCode have eased my concerns about performance (even on my 2012 Macbook Air). Plus, it's a decent way to go cross-platform between Mac and Windows (and Linux, for that matter). Program size still climbs, and I know this approach is non-optimal. But I'm learning to ignore my concerns and enjoy the ride ;)

My modified code, according to your comment:

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

One question: given that there is no "native" palette format (not that we really need one), which would you consider is the most complete format to store out palettes if we work with different formats across different tools? I'm settling with GIMP for now.

Offline Richard Moss

  • Cyotek Team
  • Administrator
  • Sr. Member
  • *****
  • Posts: 315
  • Karma: +17/-0
    • cyotek.com
Re: Gravit Designer Palette
« Reply #3 on: May 20, 2019, 03:57:05 PM »
Hello,

Thanks for the follow up! As far as palette formats go, I'd probably go with Gimp over more powerful formats, simply because it is text based and easy to read or write, even by hand and therefore is likely much more likely to be supported by third party tools. While formats like ACO do support different colour spaces and higher precision, the fact that it is binary means it's not particularly easy to use. If I didn't need name support then I might even side with the even old JASC format, again text based and easy to write.

Regards;
Richard Moss

PS: I did add a native Gravit serialiser to the palette editor an update or two back

 

anything