Repository: bevyengine/bevy
File: crates/bevy_ui/src/ui_node.rs (Rust)

Code before:
/// of sibling nodes with a lower z-index.
///
/// UI nodes that have the same z-index will appear according to the order in which they
/// appear in the UI hierarchy. In such a case, the last node to be added to its parent
/// will appear in front of its siblings.
///
/// Nodes without this component will be treated as if they had a value of
/// <code>[ZIndex][ZIndex]\(0\)</code>.
///
/// Use [`GlobalZIndex`] if you need to order separate UI hierarchies or nodes that are
/// not siblings in a given UI hierarchy.
#[derive(Component, Copy, Clone, Debug, Default, PartialEq, Eq, Reflect)]
#[reflect(Component, Default, Debug, PartialEq, Clone)]
pub struct ZIndex(pub i32);

/// `GlobalZIndex` allows a [`Node`] entity anywhere in the UI hierarchy to escape the implicit draw ordering of the UI's layout tree and
/// be rendered above or below other UI nodes.
/// Nodes with a `GlobalZIndex` of greater than 0 will be drawn on top of nodes without a `GlobalZIndex` or nodes with a lower `GlobalZIndex`.
/// Nodes with a `GlobalZIndex` of less than 0 will be drawn below nodes without a `GlobalZIndex` or nodes with a greater `GlobalZIndex`.
///
/// If two Nodes have the same `GlobalZIndex`, the node with the greater [`ZIndex`] will be drawn on top.
#[derive(Component, Copy, Clone, Debug, Default, PartialEq, Eq, Reflect)]
#[reflect(Component, Default, Debug, PartialEq, Clone)]
pub struct GlobalZIndex(pub i32);

/// Sets a color to fill the regions outside the Node's border created when a border radius is set.
#[derive(Component, Copy, Clone, Debug, Deref, DerefMut, PartialEq, Reflect)]
#[reflect(Component, Default, Debug, PartialEq, Clone)]
#[cfg_attr(
    feature = "serialize",
    derive(serde::Serialize, serde::Deserialize),
    reflect(Serialize, Deserialize)
)]
pub struct OuterColor(pub Color);

impl OuterColor {
    /// Outer color is transparent by default.
    pub const DEFAULT: Self = Self(Color::NONE);
}

impl Default for OuterColor {
    fn default() -> Self {
        Self::DEFAULT
    }
}

impl<T: Into<Color>> From<T> for OuterColor {
    fn from(color: T) -> Self {
        Self(color.into())
    }
}

Review comment (suggestion):
```suggestion
/// Sets a color to fill the regions outside the Node's border created when a border radius is set.
///
/// This can be useful to create artistic "inner radius" effects when used with extra nodes beside existing nodes,
/// such as when creating tab widgets.
```

Code after:
/// of sibling nodes with a lower z-index.
///
/// UI nodes that have the same z-index will appear according to the order in which they
/// appear in the UI hierarchy. In such a case, the last node to be added to its parent
/// will appear in front of its siblings.
///
/// Nodes without this component will be treated as if they had a value of
/// <code>[ZIndex][ZIndex]\(0\)</code>.
///
/// Use [`GlobalZIndex`] if you need to order separate UI hierarchies or nodes that are
/// not siblings in a given UI hierarchy.
#[derive(Component, Copy, Clone, Debug, Default, PartialEq, Eq, Reflect)]
#[reflect(Component, Default, Debug, PartialEq, Clone)]
pub struct ZIndex(pub i32);

/// `GlobalZIndex` allows a [`Node`] entity anywhere in the UI hierarchy to escape the implicit draw ordering of the UI's layout tree and
/// be rendered above or below other UI nodes.
/// Nodes with a `GlobalZIndex` of greater than 0 will be drawn on top of nodes without a `GlobalZIndex` or nodes with a lower `GlobalZIndex`.
/// Nodes with a `GlobalZIndex` of less than 0 will be drawn below nodes without a `GlobalZIndex` or nodes with a greater `GlobalZIndex`.
///
/// If two Nodes have the same `GlobalZIndex`, the node with the greater [`ZIndex`] will be drawn on top.
#[derive(Component, Copy, Clone, Debug, Default, PartialEq, Eq, Reflect)]
#[reflect(Component, Default, Debug, PartialEq, Clone)]
pub struct GlobalZIndex(pub i32);

/// Sets a color to fill the regions outside the Node's border created when a border radius is set.
///
/// This can be useful to create artistic "inner radius" effects when used with extra nodes beside existing nodes,
/// such as when creating tab widgets.
#[derive(Component, Copy, Clone, Debug, Deref, DerefMut, PartialEq, Reflect)]
#[reflect(Component, Default, Debug, PartialEq, Clone)]
#[cfg_attr(
    feature = "serialize",
    derive(serde::Serialize, serde::Deserialize),
    reflect(Serialize, Deserialize)
)]
pub struct OuterColor(pub Color);

impl OuterColor {
    /// Outer color is transparent by default.
    pub const DEFAULT: Self = Self(Color::NONE);
}

impl Default for OuterColor {
    fn default() -> Self {
        Self::DEFAULT
    }
}

impl<T: Into<Color>> From<T> for OuterColor {
    fn from(color: T) -> Self {