summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension/color.h
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/dimension/color.h')
-rw-r--r--libdimension/dimension/color.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libdimension/dimension/color.h b/libdimension/dimension/color.h
index 34f3884..967e9a5 100644
--- a/libdimension/dimension/color.h
+++ b/libdimension/dimension/color.h
@@ -164,6 +164,13 @@ dmnsn_color_saturate(dmnsn_color color)
return color;
}
+/** Return whether a color contains any NaN components. */
+DMNSN_INLINE bool
+dmnsn_color_isnan(dmnsn_color color)
+{
+ return isnan(color.R) || isnan(color.G) || isnan(color.B);
+}
+
/* Standard colors */
/** Black. */