palette icon indicating copy to clipboard operation
palette copied to clipboard

Support KDL for (de)serialization of color types

Open Walther opened this issue 11 months ago • 1 comments

Description

Support for serde for (de)serialization of color types was requested here https://github.com/Ogeon/palette/issues/83 and implemented here https://github.com/Ogeon/palette/pull/90.

I'm opening this issue to ask if support for KDL (de)serialization would be a desired optional feature. The most likely path for implementation is the knus crate, which provides a serde-like derive macro experience.

Motivation

General motivation

KDL is a pretty neat format, with a high focus on readability and write-ability by humans. The document language specification has just reached 2.0 and "no further changes are expected". A bunch of projects both within and outside the Rust ecosystem are adopting KDL for configuration files and more. The palette library provides wonderful strongly typed colors, and it would be great to be able to leverage them in any KDL-based files that deal with colors.

Personal motivation

I have a path tracing rendering engine project, where I use palette heavily. Thank you so much for creating such an amazing library 🧡 It has helped me immensely with making my implementation easier, more correct, and even made me find some bugs in published research papers.

I am currently planning to move my scene files from being based on JSON to KDL. The scene files describe objects, their materials, and thus also colors.

I would like to attempt adding support KDL for palette, and wanted to open the issue to ask first if this would be okay. Being mindful of the call for co-maintainers, I understand that new feature requests might not be the highest priority.

Walther avatar Jan 06 '25 13:01 Walther