crossterm-rs / crossterm

Cross platform terminal library rust
MIT License
3.28k stars 281 forks source link

Color serialization/deserialization doesn't support "Reset" value #823

Closed Destroy666x closed 10 months ago

Destroy666x commented 1 year ago

Is your feature request related to a problem? Please describe. Color serialization/deserialization doesn't support Reset value: https://github.com/crossterm-rs/crossterm/blob/8e254000c2dc2d38a6f1058fb0e7e0b3ac41e001/src/style/types/color.rs#L33

These mappings/tests lack it: https://github.com/crossterm-rs/crossterm/blob/8e254000c2dc2d38a6f1058fb0e7e0b3ac41e001/src/style/types/color.rs#L176 https://github.com/crossterm-rs/crossterm/blob/8e254000c2dc2d38a6f1058fb0e7e0b3ac41e001/src/style/types/color.rs#L226 https://github.com/crossterm-rs/crossterm/blob/8e254000c2dc2d38a6f1058fb0e7e0b3ac41e001/src/style/types/color.rs#L346 https://github.com/crossterm-rs/crossterm/blob/8e254000c2dc2d38a6f1058fb0e7e0b3ac41e001/src/style/types/color.rs#L392 etc.

I don't see why it's missing, other than someone just forgetting to add it, but maybe I'm missing something - if so let me know.

Describe the solution you'd like Serialize/deserialize Reset value too.

Describe alternatives you've considered if any -

Additional context Would fix e.g. https://github.com/lsd-rs/lsd/issues/896 / https://github.com/lsd-rs/lsd/issues/607 without any need for workarounds.