Skip to content

Commit

Permalink
Add light palette (#480)
Browse files Browse the repository at this point in the history
* Add light palette

* Fix broken test

* Update changelog
  • Loading branch information
vinc authored Apr 16, 2023
1 parent f54560e commit 72ea9c1
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Unreleased
- Add light palette (#480)
- Fix invalid bytes from serial (#479)
- Use pbkdf2_hmac to fix compilation warnings (#477)
- Bump spin from 0.9.5 to 0.9.6 (#474)
Expand Down
2 changes: 1 addition & 1 deletion dsk/ini/boot.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
vga set palette /ini/palette.csv
vga set palette /ini/palettes/gruvbox-dark.csv
vga set font /ini/fonts/zap-light-8x16.psf
read /ini/banner.txt
user login
Expand Down
3 changes: 1 addition & 2 deletions dsk/ini/palette.csv → dsk/ini/palettes/gruvbox-dark.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# VGA Palette File (Red, Green, Blue)
# Dark Gruvbox color palette
0x28, 0x28, 0x28 # Black
0x45, 0x85, 0x88 # Blue
0x98, 0x97, 0x1A # Green
Expand All @@ -15,4 +14,4 @@
0xFB, 0x49, 0x34 # Light Red
0xD3, 0x86, 0x9B # Pink (Light Magenta)
0xFA, 0xBD, 0x2F # Yellow (Light Yellow)
0xFB, 0xF1, 0xF7 # White
0xFB, 0xF1, 0xC7 # White
17 changes: 17 additions & 0 deletions dsk/ini/palettes/gruvbox-light.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# VGA Palette File (Red, Green, Blue)
0xFB, 0xF1, 0xC7 # Black
0x45, 0x85, 0x88 # Blue
0x98, 0x97, 0x1A # Green
0x68, 0x9D, 0x6A # Cyan
0xCC, 0x24, 0x1D # Red
0xB1, 0x62, 0x86 # Magenta
0xD7, 0x99, 0x21 # Brown (Dark Yellow)
0x3C, 0x38, 0x36 # Light Gray
0x7C, 0x6F, 0x64 # Dark Gray (Gray)
0x07, 0x66, 0x78 # Light Blue
0x79, 0x74, 0x0E # Light Green
0x42, 0x7B, 0x58 # Light Cyan
0x9D, 0x00, 0x06 # Light Red
0x8F, 0x3F, 0x71 # Pink (Light Magenta)
0xB5, 0x76, 0x14 # Yellow (Light Yellow)
0x28, 0x28, 0x28 # White
2 changes: 1 addition & 1 deletion src/api/vga/palette.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn parse_palette_csv() {
assert!(from_csv("").is_err());
assert!(from_csv("0,0,0,0").is_err());

let s = include_str!("../../../dsk/ini/palette.csv");
let s = include_str!("../../../dsk/ini/palettes/gruvbox-dark.csv");
let palette = from_csv(s).unwrap();
assert_eq!(palette.colors[0x03].0, 0x68);
assert_eq!(palette.colors[0x0D].1, 0x86);
Expand Down
7 changes: 5 additions & 2 deletions src/usr/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ pub fn copy_files(verbose: bool) {

copy_file("/ini/banner.txt", include_bytes!("../../dsk/ini/banner.txt"), verbose);
copy_file("/ini/boot.sh", include_bytes!("../../dsk/ini/boot.sh"), verbose);
copy_file("/ini/palette.csv", include_bytes!("../../dsk/ini/palette.csv"), verbose);
copy_file("/ini/shell.sh", include_bytes!("../../dsk/ini/shell.sh"), verbose);
copy_file("/ini/version.txt", include_bytes!("../../dsk/ini/version.txt"), verbose);

create_dir("/ini/palettes", verbose);
copy_file("/ini/palettes/gruvbox-dark.csv", include_bytes!("../../dsk/ini/palettes/gruvbox-dark.csv"), verbose);
copy_file("/ini/palettes/gruvbox-light.csv", include_bytes!("../../dsk/ini/palettes/gruvbox-light.csv"), verbose);

create_dir("/ini/fonts", verbose);
copy_file("/ini/fonts/lat15-terminus-8x16.psf", include_bytes!("../../dsk/ini/fonts/lat15-terminus-8x16.psf"), verbose);
//copy_file("/ini/fonts/lat15-terminus-8x16.psf", include_bytes!("../../dsk/ini/fonts/lat15-terminus-8x16.psf"), verbose);
copy_file("/ini/fonts/zap-light-8x16.psf", include_bytes!("../../dsk/ini/fonts/zap-light-8x16.psf"), verbose);
copy_file("/ini/fonts/zap-vga-8x16.psf", include_bytes!("../../dsk/ini/fonts/zap-vga-8x16.psf"), verbose);

Expand Down

0 comments on commit 72ea9c1

Please sign in to comment.