diff --git a/examples/al-aas225.html b/examples/al-aas225.html
index 6140dc05..d577757f 100644
--- a/examples/al-aas225.html
+++ b/examples/al-aas225.html
@@ -11,7 +11,7 @@
let aladin;
A.init.then(() => {
aladin = A.aladin('#aladin-lite-div', { fov:0.15, target: 'Arp 240', showReticle: false, fullScreen: true });
- aladin.setBaseImageLayer(aladin.newImageSurvey('P/SDSS9/g', {colormap: "sinebow", stretch: "Linear"}));
+ aladin.setBaseImageLayer(aladin.newImageSurvey('P/SDSS9/g', {colormap: "rainbow", stretch: "Linear"}));
var simbad = A.catalog({name: 'Simbad', sourceSize: 16, color: '#4050F0'});
aladin.addCatalog(simbad);
diff --git a/examples/al-set-colormap.html b/examples/al-set-colormap.html
index fa3c4694..8a3db107 100644
--- a/examples/al-set-colormap.html
+++ b/examples/al-set-colormap.html
@@ -12,7 +12,7 @@
let aladin;
A.init.then(() => {
aladin = A.aladin('#aladin-lite-div', {cooFrame: 'galactic', target: 'galactic center', survey: 'P/Finkbeiner'});
- // possible values are 'blues', 'cividis', 'cubehelix', 'eosb', 'grayscale', 'inferno', 'magma', 'native', 'parula', 'plasma',
+ // possible values are 'blues', 'cividis', 'cubehelix', 'eosb', 'grayscale', 'inferno', 'magma', 'native', 'parula', 'plasma', 'rainbow',
// 'rdbu', 'rdylbu', 'redtemperature', 'sinebow', 'spectral', 'summer', 'viridis', 'ylgnbu' and 'ylorbr'
aladin.getBaseImageLayer().setColormap("cubehelix");
//aladin.getBaseImageLayer().setColor([1.0, 0.0, 1.0, 1.0], { tf: 'Linear'} );
diff --git a/src/core/al-core/src/colormap.rs b/src/core/al-core/src/colormap.rs
index 282d9c36..1a4d4a92 100644
--- a/src/core/al-core/src/colormap.rs
+++ b/src/core/al-core/src/colormap.rs
@@ -89,7 +89,7 @@ impl Colormaps {
let labels: Vec<_> = [
"blues", "cividis", "cubehelix", "eosb",
"grayscale", "inferno", "magma", "native",
- "parula", "plasma", "rdbu",
+ "parula", "plasma", "rainbow", "rdbu",
"rdylbu", "redtemperature", "sinebow", "spectral", "summer",
"viridis", "ylgnbu", "ylorbr", "red", "green", "blue"
]
@@ -135,6 +135,23 @@ impl Colormaps {
.map_err(|err| JsValue::from_str(&format!("{:?}", err)))?
}),
Colormap::new("plasma", colorgrad::plasma()),
+ Colormap::new("rainbow", {
+ colorgrad::CustomGradient::new()
+ .colors(&[
+ Color::from_rgba8(127, 0, 255, 255),
+ Color::from_rgba8(0, 0, 255, 255),
+ Color::from_rgba8(0, 127, 255, 255),
+ Color::from_rgba8(0, 255, 255, 255),
+ Color::from_rgba8(0, 255, 127, 255),
+ Color::from_rgba8(0, 255, 0, 255),
+ Color::from_rgba8(127, 255, 0, 255),
+ Color::from_rgba8(255, 255, 0, 255),
+ Color::from_rgba8(255, 127, 0, 255),
+ Color::from_rgba8(255, 0, 0, 255),
+ ])
+ .build()
+ .map_err(|err| JsValue::from_str(&format!("{:?}", err)))?
+ }),
Colormap::new("rdbu", colorgrad::rd_bu()),
Colormap::new("rdylbu", colorgrad::rd_yl_bu()),
Colormap::new("redtemperature", {