rgba by default for *ref

This commit is contained in:
TerraMaster85 2025-05-17 21:53:56 -04:00
parent 4ee16ada3c
commit b1ad04f45f
3 changed files with 19 additions and 22 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ node_modules
.cache .cache
wxbox_client_wasm/dist wxbox_client_wasm/dist
crates/client/dist crates/client/dist
*/bun.lockb

View file

@ -3,14 +3,14 @@ from = "https://mrms.ncep.noaa.gov/data/2D/MergedReflectivityQCComposite/MRMS_Me
needs_gzip = true needs_gzip = true
valid_for = 120 valid_for = 120
palette = """ palette = """
Color: 10 164 164 255 100 100 192 Color4: 10 164 164 255 0 100 100 192 255
Color: 20 64 128 255 32 64 128 Color4: 20 64 128 255 255 32 64 128 255
Color: 30 0 255 0 0 128 0 Color4: 30 0 255 0 255 0 128 0 255
Color: 40 255 255 0 255 128 0 Color4: 40 255 255 0 255 255 128 0 255
Color: 50 255 0 0 160 0 0 Color4: 50 255 0 0 255 160 0 0 255
Color: 60 255 0 255 128 0 128 Color4: 60 255 0 255 255 128 0 128 255
Color: 70 255 255 255 128 128 128 Color4: 70 255 255 255 255 128 128 128 255
Color: 80 128 128 128 Color4: 80 128 128 128 255
""" """
missing = -99.0 missing = -99.0
no_coverage = -999.0 no_coverage = -999.0
@ -18,12 +18,12 @@ no_coverage = -999.0
[data.nexrad.base_reflectivity_halfdegree] [data.nexrad.base_reflectivity_halfdegree]
from = "DS.p94r0" from = "DS.p94r0"
palette = """ palette = """
Color: 10 164 164 255 100 100 192 Color4: 10 164 164 255 0 100 100 192 255
Color: 20 64 128 255 32 64 128 Color4: 20 64 128 255 255 32 64 128 255
Color: 30 0 255 0 0 128 0 Color4: 30 0 255 0 255 0 128 0 255
Color: 40 255 255 0 255 128 0 Color4: 40 255 255 0 255 255 128 0 255
Color: 50 255 0 0 160 0 0 Color4: 50 255 0 0 255 160 0 0 255
Color: 60 255 0 255 128 0 128 Color4: 60 255 0 255 255 128 0 128 255
Color: 70 255 255 255 128 128 128 Color4: 70 255 255 255 255 128 128 128 255
Color: 80 128 128 128 Color4: 80 128 128 128 255
""" """

View file

@ -230,11 +230,7 @@ fn colorize(value: Option<f64>, data_source: &Grib2DataSource) -> anyhow::Result
color.red, color.red,
color.green, color.green,
color.blue, color.blue,
if color.red == 0 && color.green == 0 && color.blue == 0 { color.alpha, // guaranteed to be present afaict
0
} else {
255
},
]) ])
} }
None => Rgba([0, 0, 0, 30]), None => Rgba([0, 0, 0, 30]),