From 48d098134e1af7a1b0bfa2f15c85b89e41572f66 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Wed, 20 May 2020 01:03:40 +0100 Subject: [PATCH] One more palette fix --- internal/palettes/chaos_gate.go | 3 ++- internal/palettes/soldiers_at_war.go | 3 ++- scripts/palette-from-pcx | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/internal/palettes/chaos_gate.go b/internal/palettes/chaos_gate.go index 88e249d..ab602cb 100644 --- a/internal/palettes/chaos_gate.go +++ b/internal/palettes/chaos_gate.go @@ -4,7 +4,8 @@ import "image/color" var ( ChaosGatePalette = color.Palette{ - color.RGBA{R: 0, G: 0, B: 0, A: 255}, + Transparent, + color.RGBA{R: 128, G: 0, B: 0, A: 255}, color.RGBA{R: 0, G: 128, B: 0, A: 255}, color.RGBA{R: 128, G: 128, B: 0, A: 255}, diff --git a/internal/palettes/soldiers_at_war.go b/internal/palettes/soldiers_at_war.go index 50052d7..5eb10f5 100644 --- a/internal/palettes/soldiers_at_war.go +++ b/internal/palettes/soldiers_at_war.go @@ -4,7 +4,8 @@ import "image/color" var ( SoldiersAtWarPalette = color.Palette{ - color.RGBA{R: 0, G: 0, B: 0, A: 255}, + Transparent, + color.RGBA{R: 128, G: 0, B: 0, A: 255}, color.RGBA{R: 0, G: 128, B: 0, A: 255}, color.RGBA{R: 128, G: 128, B: 0, A: 255}, diff --git a/scripts/palette-from-pcx b/scripts/palette-from-pcx index 00060c3..4c02149 100755 --- a/scripts/palette-from-pcx +++ b/scripts/palette-from-pcx @@ -23,11 +23,13 @@ import "image/color" var ( #{PALETTENAME}Palette = color.Palette{ + Transparent, + EOF -# bytes.shift(3) # Ignore idx 0 so we can make it transparent +bytes.read(3) # Ignore idx 0 so we can make it transparent -256.times do +255.times do r, g, b = f.read(3).bytes puts "\t\tcolor.RGBA{R: #{r}, G: #{g}, B: #{b}, A: 255},"