add rgbv with_o
This commit is contained in:
parent
750fb3a204
commit
e83a3bba36
1 changed files with 10 additions and 0 deletions
|
@ -62,6 +62,16 @@ impl Rgbv {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn with_o(&self, o: u8) -> Rgbv {
|
||||
assert!(o <= Self::MAX_O);
|
||||
Self {
|
||||
r: self.r,
|
||||
g: self.g,
|
||||
b: self.b,
|
||||
_o: o | Self::_O_ONES,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn o(self) -> u8 {
|
||||
self._o & !Self::_O_ONES
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue