mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-29 15:00:42 +02:00
docs(schema): ensure all public-facing static config opts have docstrings
This commit is contained in:
@@ -11,6 +11,7 @@ use serde::Serialize;
|
||||
#[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
#[serde(untagged)]
|
||||
/// Colour representation
|
||||
pub enum Colour {
|
||||
/// Colour represented as RGB
|
||||
Rgb(Rgb),
|
||||
@@ -52,6 +53,7 @@ impl From<Colour> for Color32 {
|
||||
}
|
||||
}
|
||||
|
||||
/// Colour represented as a Hex string
|
||||
#[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)]
|
||||
pub struct Hex(pub HexColor);
|
||||
|
||||
@@ -64,7 +66,8 @@ impl schemars::JsonSchema for Hex {
|
||||
fn json_schema(_: &mut SchemaGenerator) -> Schema {
|
||||
schemars::json_schema!({
|
||||
"type": "string",
|
||||
"format": "color-hex"
|
||||
"format": "color-hex",
|
||||
"description": "Colour represented as a Hex string"
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -80,6 +83,7 @@ impl From<Colour> for u32 {
|
||||
|
||||
#[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
/// Colour represented as RGB
|
||||
pub struct Rgb {
|
||||
/// Red
|
||||
pub r: u32,
|
||||
|
||||
Reference in New Issue
Block a user