Skip to content

Commit

Permalink
Merge pull request #190 from jetjinser/fix-color-mask
Browse files Browse the repository at this point in the history
fix: color bitmask calculation
  • Loading branch information
caemor authored Oct 28, 2024
2 parents 1244f03 + 0b1644c commit c0f48d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl ColorType for OctColor {
const BITS_PER_PIXEL_PER_BUFFER: usize = 4;
const BUFFER_COUNT: usize = 1;
fn bitmask(&self, _bwrbit: bool, pos: u32) -> (u8, u16) {
let mask = !(0xF0 >> (pos % 2));
let mask = !(0xF0 >> (pos % 2) * 4);
let bits = self.get_nibble() as u16;
(mask, if pos % 2 == 1 { bits } else { bits << 4 })
}
Expand Down

0 comments on commit c0f48d7

Please sign in to comment.