]> Pileus Git - aweather/blobdiff - src/plugins/radar-info.h
docs: fix a few typos
[aweather] / src / plugins / radar-info.h
index 664eeb1b9eb97db58e11f2b40fc13993f291f1a3..8daf2b936d12a34accad88476289e6c0f968e21a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009-2010 Andy Spencer <andy753421@gmail.com>
+ * Copyright (C) 2009-2011 Andy Spencer <andy753421@gmail.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -33,4 +33,10 @@ typedef struct {
 
 extern AWeatherColormap colormaps[];
 
+static inline guint8 *colormap_get(AWeatherColormap *colormap, float value)
+{
+       int idx = value * colormap->scale + colormap->shift;
+       return colormap->data[CLAMP(idx, 0, colormap->len)];
+}
+
 #endif