Skip to content

Commit

Permalink
improve divergent docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhhughes committed Aug 5, 2024
1 parent 3639b5f commit 16868cb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions include/spark_dsg/colormaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,19 @@ Color hls(float value,

/**
* @brief Generate a color from a general divergent colormap
* @param value A value in [0, 1]. 0 results in one color, 1 in the other, and 0.5 in a
* neutral color
* @param value A value in [0, 1]. 0 results in hue_low, 0.5 in a neutral color, and 1.0
* in hue_high
* @param hue_low The hue value to use for colors in the 0 to 0.5 range
* @param hue_high The hue value to use for colors in the 0.5 to 1 range
* @param saturation The starting saturation for both endpoints in the colormap
* @param luminance The starting luminance for both endpoints in the colormap
* @param dark Whether the midpoint goes to black (true) or white (false)
*
* @note This colormap is created by interpolating the endpoint luminance and saturation
* and either 0 (dark) or 1 (white). Setting saturation to be high creates more color
* constrast while luminance changes the intensity gradient between the endpoints and
* the midpoint. When using dark = false, please note that luminance should be set on
* the lower side for the endpoints.
*/
Color divergent(float value,
float hue_low = 0.66,
Expand Down

0 comments on commit 16868cb

Please sign in to comment.