Ogeon / palette

A Rust library for linear color calculations and conversion
Apache License 2.0
748 stars 60 forks source link

Consider replacing `Default` implementations with a `Black` trait or similar #324

Open Ogeon opened 1 year ago

Ogeon commented 1 year ago

Description

Replace the current Default implementations with more "regular" versions that just sets the component values to their defaults. There should rather be a trait, such as Black (and White), or constants for the current use, to make the intent more explicit.

Motivation

The current Default implementations require more than just Default from the component values and the semantics get a bit weird with struct-of-arrays values. Separating the "default value" and "black color" concepts would make this less ambiguous.