mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Make Palette::add_namespace public
This commit is contained in:
parent
8acc08f340
commit
9569e991bf
@ -32,10 +32,16 @@ pub struct Palette {
|
|||||||
|
|
||||||
/// A node in the palette tree.
|
/// A node in the palette tree.
|
||||||
///
|
///
|
||||||
|
/// This describes a value attached to a custom keyword in the palette.
|
||||||
|
///
|
||||||
/// This can either be a color, or a nested namespace with its own mapping.
|
/// This can either be a color, or a nested namespace with its own mapping.
|
||||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||||
enum PaletteNode {
|
pub enum PaletteNode {
|
||||||
|
/// A single color.
|
||||||
Color(Color),
|
Color(Color),
|
||||||
|
/// A group of values bundled in the same namespace.
|
||||||
|
///
|
||||||
|
/// Namespaces can be merged in the palette with `Palette::merge`.
|
||||||
Namespace(HashMap<String, PaletteNode>),
|
Namespace(HashMap<String, PaletteNode>),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +123,7 @@ impl Palette {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Adds a color namespace to this palette.
|
/// Adds a color namespace to this palette.
|
||||||
fn add_namespace(
|
pub fn add_namespace(
|
||||||
&mut self, key: &str, namespace: HashMap<String, PaletteNode>,
|
&mut self, key: &str, namespace: HashMap<String, PaletteNode>,
|
||||||
) {
|
) {
|
||||||
self.custom
|
self.custom
|
||||||
|
Loading…
Reference in New Issue
Block a user