]> Pileus Git - aweather/blobdiff - src/plugins/radar-info.h
Increase volume size and fix colormap bugs
[aweather] / src / plugins / radar-info.h
index 664eeb1b9eb97db58e11f2b40fc13993f291f1a3..db0e127161b84d3b1188eee621afbe7c0bace955 100644 (file)
@@ -33,4 +33,10 @@ typedef struct {
 
 extern AWeatherColormap colormaps[];
 
+static inline guint8 *colormap_get(AWeatherColormap *colormap, int value)
+{
+       int idx = value * colormap->scale + colormap->shift;
+       return colormap->data[CLAMP(idx, 0, colormap->len)];
+}
+
 #endif