add demos to README.md

This commit is contained in:
Abe Pazos
2025-11-22 18:16:54 +00:00
parent 522627ca51
commit 4af2ed3fed
4 changed files with 185 additions and 6 deletions

View File

@@ -51,7 +51,12 @@ Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an impleme
## Demos
### colormap/DemoSpectralZucconiColormap
This program demonstrates the `spectralZucconi6()` function, which
takes a normalized value and returns a `ColorRGBa` using the
accurate spectral colormap developed by Alan Zucconi.
It draws a varying number of vertical bands (between 16 and 48)
filled with various hues.
![colormap-DemoSpectralZucconiColormapKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormap-DemoSpectralZucconiColormapKt.png)
@@ -59,7 +64,13 @@ Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an impleme
### colormap/DemoSpectralZucconiColormapPhrase
This program demonstrates how to use the shader-based version of
the `spectral_zucconi6()` function, which
takes a normalized value and returns an `rgb` color using the
accurate spectral colormap developed by Alan Zucconi.
It shades a full-window rectangle using its normalized `x` coordinate
in a `ShadeStyle` to choose pixel colors.
![colormap-DemoSpectralZucconiColormapPhraseKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormap-DemoSpectralZucconiColormapPhraseKt.png)
@@ -67,7 +78,11 @@ Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an impleme
### colormap/DemoSpectralZucconiColormapPlot
This demo uses the shader based `spectral_zucconi6()` function to fill the background,
then visualizes the red, green and blue components of the colors used in the background
as red, green and blue line strips.
The Vector2 points for the line strips are calculated only once when the program starts.
![colormap-DemoSpectralZucconiColormapPlotKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormap-DemoSpectralZucconiColormapPlotKt.png)
@@ -75,7 +90,12 @@ Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an impleme
### colormap/DemoTurboColormap
This program demonstrates the `turboColormap()` function, which
takes a normalized value and returns a `ColorRGBa` using the
Turbo colormap developed by Google.
It draws a varying number of vertical bands (between 16 and 48)
filled with various hues.
![colormap-DemoTurboColormapKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormap-DemoTurboColormapKt.png)
@@ -83,7 +103,13 @@ Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an impleme
### colormap/DemoTurboColormapPhrase
This program demonstrates how to use the shader-based version of
the `turbo_colormap()` function, which
takes a normalized value and returns an `rgb` color using the
Turbo colormap developed by Google.
It shades a full-window rectangle using its normalized `x` coordinate
in a `ShadeStyle` to choose pixel colors.
![colormap-DemoTurboColormapPhraseKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormap-DemoTurboColormapPhraseKt.png)
@@ -91,7 +117,11 @@ Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an impleme
### colormap/DemoTurboColormapPlot
This demo uses the shader based `turbo_colormap()` function to fill the background,
then visualizes the red, green and blue components of the colors used in the background
as red, green and blue line strips.
The Vector2 points for the line strips are calculated only once when the program starts.
![colormap-DemoTurboColormapPlotKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colormap-DemoTurboColormapPlotKt.png)
@@ -171,7 +201,8 @@ to position the images dynamically based on their index within the grid.
### colorRange/DemoColorRange01
Comparison of color lists generated by interpolating from
`PINK` to `BLUE` in six different color spaces.
![colorRange-DemoColorRange01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colorRange-DemoColorRange01Kt.png)
@@ -179,7 +210,13 @@ to position the images dynamically based on their index within the grid.
### colorRange/DemoColorRange02
Demonstrates how to create a `ColorSequence` containing three colors, one of them in the HSLUV color space.
Each color in the sequence is assigned a normalized position: in this program, one at the start (0.0),
one in the middle (0.5) and one at the end (1.0).
The `ColorSpace.blend()` method is used to get a list with 18 interpolated `ColorRGBa` colors,
then those colors are drawn as vertical rectangles covering the whole window.
![colorRange-DemoColorRange02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colorRange-DemoColorRange02Kt.png)
@@ -187,7 +224,13 @@ to position the images dynamically based on their index within the grid.
### colorRange/DemoColorRange03
This program creates color interpolations from `ColorRGBa.BLUE` to
`ColorRGBa.PINK` in 25 steps in multiple color spaces.
The window height is adjusted based on the number of interpolations to show.
The resulting gradients differ in saturation and brightness and apparently include more
`BLUE` or more `PINK` depending on the chosen color space.
![colorRange-DemoColorRange03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colorRange-DemoColorRange03Kt.png)
@@ -195,6 +238,17 @@ to position the images dynamically based on their index within the grid.
### colorRange/DemoColorRange04
A visualization of color interpolations inside a 3D RGB cube with an interactive 3D `Orbital` camera.
The hues of the source and target colors are animated over time.
The color interpolations are shown simultaneously in nine different color spaces, revealing how in
each case they share common starting and ending points in 3D, but have unique paths going from
start to end.
By rotating the cube 90 degrees towards the left and slightly zooming out, one can appreciate how
one of the points moves along the edges of the cube, while the other moves on the edges of a
smaller, invisible cube.
![colorRange-DemoColorRange04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-color/images/colorRange-DemoColorRange04Kt.png)