Skip to content

Commit

Permalink
Rename Color#to_vga_reg to Color#register
Browse files Browse the repository at this point in the history
  • Loading branch information
vinc committed Oct 14, 2024
1 parent 1f765d6 commit fcc555a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/sys/vga/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl Color {
}
}

pub fn to_vga_reg(&self) -> u8 {
pub fn register(&self) -> usize {
match self {
Color::DarkBlack => 0x00,
Color::DarkBlue => 0x01,
Expand Down
2 changes: 1 addition & 1 deletion src/sys/vga/palette.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Palette {
pub fn default() -> Palette {
let mut colors = [(0, 0, 0); 256];
for (i, (r, g, b)) in DEFAULT_COLORS.iter().enumerate() {
let i = Color::from_index(i).to_vga_reg() as usize;
let i = Color::from_index(i).register();
colors[i] = (*r, *g, *b);
}
Palette { colors }
Expand Down
2 changes: 1 addition & 1 deletion src/sys/vga/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ impl Perform for Writer {
match s.chars().next() {
Some('P') if s.len() == 8 => {
if let Ok((i, r, g, b)) = parse_palette(&s) {
let i = Color::from_index(i).to_vga_reg() as usize;
let i = Color::from_index(i).register();
self.set_palette(i, r, g, b);
}
}
Expand Down

0 comments on commit fcc555a

Please sign in to comment.