pub struct PaletteDef {
pub colors: BTreeMap<String, [u8; 3]>,
}Expand description
The validated palette: colour name → RGB.
Fields§
§colors: BTreeMap<String, [u8; 3]>Every colour in the file, by name.
Implementations§
Source§impl PaletteDef
impl PaletteDef
Sourcepub fn from_ink_source(
file: &str,
source: &str,
base: &PaletteDef,
) -> Result<Self, Vec<ContentError>>
pub fn from_ink_source( file: &str, source: &str, base: &PaletteDef, ) -> Result<Self, Vec<ContentError>>
Parses palette source of ink names (errors attributed to file)
into each ink’s code. Reports every unknown ink and every colour of
base it lacks.
Source§impl PaletteDef
impl PaletteDef
Sourcepub fn from_source(
file: &str,
source: &str,
required: &[&str],
) -> Result<Self, Vec<ContentError>>
pub fn from_source( file: &str, source: &str, required: &[&str], ) -> Result<Self, Vec<ContentError>>
Parses and validates palette source, attributing errors to file.
Reports every bad hex value and every colour of required it lacks.
Trait Implementations§
Source§impl AssetKind for PaletteDef
impl AssetKind for PaletteDef
Source§impl Clone for PaletteDef
impl Clone for PaletteDef
Source§fn clone(&self) -> PaletteDef
fn clone(&self) -> PaletteDef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PaletteDef
impl Debug for PaletteDef
Source§impl Default for PaletteDef
impl Default for PaletteDef
Source§fn default() -> PaletteDef
fn default() -> PaletteDef
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PaletteDef
impl<'de> Deserialize<'de> for PaletteDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PaletteDef
Source§impl PartialEq for PaletteDef
impl PartialEq for PaletteDef
Source§impl Serialize for PaletteDef
impl Serialize for PaletteDef
impl StructuralPartialEq for PaletteDef
Auto Trait Implementations§
impl Freeze for PaletteDef
impl RefUnwindSafe for PaletteDef
impl Send for PaletteDef
impl Sync for PaletteDef
impl Unpin for PaletteDef
impl UnsafeUnpin for PaletteDef
impl UnwindSafe for PaletteDef
Blanket Implementations§
impl<K> Bakeable for K
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more