├── images ├── 0hsv.png ├── cpmm.png ├── HSP_no.png ├── LSin_no.png ├── Root_no.png ├── Sin_no.png ├── Sqrt_no.png ├── Tanh_no.png ├── arctic.png ├── julia85.png ├── siegel.png ├── Cubic_no.png ├── Gamma_no.png ├── HSP_no_2D.png ├── HSP_steps.png ├── HSP_tubes.png ├── LSin_no_2D.png ├── LSin_steps.png ├── LSin_tubes.png ├── Linas2_no.png ├── Linas_no.png ├── Linear_no.png ├── Magma_no.png ├── Root_no_2D.png ├── Root_steps.png ├── Root_tubes.png ├── SinExp_no.png ├── Sin_no_2D.png ├── Sin_steps.png ├── Sin_tubes.png ├── Smooth_no.png ├── Sqrt_no_2D.png ├── Sqrt_steps.png ├── Sqrt_tubes.png ├── Tanh_no_2D.png ├── Tanh_steps.png ├── Tanh_tubes.png ├── fractint.png ├── 0_3d_60_75_v.png ├── CoolWarm_no.png ├── Cubehelix_no.png ├── CubicInv_no.png ├── Cubic_no_2D.png ├── Cubic_steps.png ├── Cubic_tubes.png ├── Gamma_no_2D.png ├── Gamma_steps.png ├── Gamma_tubes.png ├── GreenSin_no.png ├── HSP_steps_2D.png ├── HSP_tubes_2D.png ├── Linas2_no_2D.png ├── Linas2_steps.png ├── Linas2_tubes.png ├── Linas_no_2D.png ├── Linas_steps.png ├── Linas_tubes.png ├── Linear_no_2D.png ├── Linear_steps.png ├── Linear_tubes.png ├── Magma_no_2D.png ├── Magma_steps.png ├── Magma_tubes.png ├── Quadratic_no.png ├── SinExp_no_2D.png ├── SinExp_steps.png ├── SinExp_tubes.png ├── Sin_steps_2D.png ├── Sin_tubes_2D.png ├── Smooth_no_2D.png ├── Smooth_steps.png ├── Smooth_tubes.png ├── 17_3d_60_75_v.png ├── BlueCubicInv_no.png ├── CoolWarm_no_2D.png ├── CoolWarm_steps.png ├── CoolWarm_tubes.png ├── Cubehelix_no_2D.png ├── Cubehelix_steps.png ├── Cubehelix_tubes.png ├── CubicInv_no_2D.png ├── CubicInv_steps.png ├── CubicInv_tubes.png ├── Cubic_steps_2D.png ├── Cubic_tubes_2D.png ├── Gamma_steps_2D.png ├── Gamma_tubes_2D.png ├── GreenCubic_no.png ├── GreenSin_no_2D.png ├── GreenSin_steps.png ├── GreenSin_tubes.png ├── LSin_steps_2D.png ├── LSin_tubes_2D.png ├── Linas2_steps_2D.png ├── Linas2_tubes_2D.png ├── Linas_steps_2D.png ├── Linas_tubes_2D.png ├── Linear_steps_2D.png ├── Linear_tubes_2D.png ├── Magma_steps_2D.png ├── Magma_tubes_2D.png ├── Quadratic_no_2D.png ├── Quadratic_steps.png ├── Quadratic_tubes.png ├── RainbowHSP_no.png ├── RainbowHSV_no.png ├── RedCubicInv_no.png ├── Root_steps_2D.png ├── Root_tubes_2D.png ├── SinExp_steps_2D.png ├── SinExp_tubes_2D.png ├── Smooth_steps_2D.png ├── Smooth_tubes_2D.png ├── Sqrt_steps_2D.png ├── Sqrt_tubes_2D.png ├── Tanh_steps_2D.png ├── Tanh_tubes_2D.png ├── CoolWarm_steps_2D.png ├── CoolWarm_tubes_2D.png ├── CubicInv_steps_2D.png ├── CubicInv_tubes_2D.png ├── GreenCubicInv_no.png ├── GreenCubicRoot_no.png ├── GreenCubic_no_2D.png ├── GreenCubic_steps.png ├── GreenCubic_tubes.png ├── GreenSin_steps_2D.png ├── GreenSin_tubes_2D.png ├── RainbowHSP_no_2D.png ├── RainbowHSP_steps.png ├── RainbowHSP_tubes.png ├── RainbowHSV_no_2D.png ├── RainbowHSV_steps.png ├── RainbowHSV_tubes.png ├── RedCubicInv_no_2D.png ├── RedCubicInv_steps.png ├── RedCubicInv_tubes.png ├── BlueCubicInv_no_2D.png ├── BlueCubicInv_steps.png ├── BlueCubicInv_tubes.png ├── Cubehelix_steps_2D.png ├── Cubehelix_tubes_2D.png ├── GreenCubicInv_no_2D.png ├── GreenCubicInv_steps.png ├── GreenCubicInv_tubes.png ├── GreenCubicRoot_no_2D.png ├── GreenCubicRoot_steps.png ├── GreenCubicRoot_tubes.png ├── GreenCubic_steps_2D.png ├── GreenCubic_tubes_2D.png ├── Quadratic_steps_2D.png ├── Quadratic_tubes_2D.png ├── RainbowHSP_steps_2D.png ├── RainbowHSP_tubes_2D.png ├── RainbowHSV_steps_2D.png ├── RainbowHSV_tubes_2D.png ├── RedCubicInv_steps_2D.png ├── RedCubicInv_tubes_2D.png ├── coolwarm3dRGB_60_75.png ├── BlueCubicInv_steps_2D.png ├── BlueCubicInv_tubes_2D.png ├── GreenCubicInv_steps_2D.png ├── GreenCubicInv_tubes_2D.png ├── RainbowFractalizer_no.png ├── GreenCubicRoot_steps_2D.png ├── GreenCubicRoot_tubes_2D.png ├── OrangeBlueFractalizer_no.png ├── RainbowFractalizer_no_2D.png ├── RainbowFractalizer_steps.png ├── RainbowFractalizer_tubes.png ├── OrangeBlueFractalizer_no_2D.png ├── OrangeBlueFractalizer_steps.png ├── OrangeBlueFractalizer_tubes.png ├── RainbowFractalizer_steps_2D.png ├── RainbowFractalizer_tubes_2D.png ├── OrangeBlueFractalizer_steps_2D.png └── OrangeBlueFractalizer_tubes_2D.png ├── src ├── Makefile ├── g.sh ├── simplest_regression.py ├── plot.gp ├── s.c ├── fractint.map ├── cubehelix.gp ├── arctic.gpf ├── plot3d.gp ├── plot2.gp ├── h.c ├── GrayL.json ├── Green.json ├── Linas.json ├── Magma.json ├── GrayNL2.json ├── CoolWarm.json ├── GrayNL2.json ├── GrayNL3.json ├── GraySqrt.json ├── NewLinas.json └── Cubehelix.json └── doc ├── TODO.md ├── colorwheel.md ├── DICTIONARY.md └── LINKS.md /images/0hsv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/0hsv.png -------------------------------------------------------------------------------- /images/cpmm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/cpmm.png -------------------------------------------------------------------------------- /images/HSP_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/HSP_no.png -------------------------------------------------------------------------------- /images/LSin_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/LSin_no.png -------------------------------------------------------------------------------- /images/Root_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Root_no.png -------------------------------------------------------------------------------- /images/Sin_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Sin_no.png -------------------------------------------------------------------------------- /images/Sqrt_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Sqrt_no.png -------------------------------------------------------------------------------- /images/Tanh_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Tanh_no.png -------------------------------------------------------------------------------- /images/arctic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/arctic.png -------------------------------------------------------------------------------- /images/julia85.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/julia85.png -------------------------------------------------------------------------------- /images/siegel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/siegel.png -------------------------------------------------------------------------------- /images/Cubic_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Cubic_no.png -------------------------------------------------------------------------------- /images/Gamma_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Gamma_no.png -------------------------------------------------------------------------------- /images/HSP_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/HSP_no_2D.png -------------------------------------------------------------------------------- /images/HSP_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/HSP_steps.png -------------------------------------------------------------------------------- /images/HSP_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/HSP_tubes.png -------------------------------------------------------------------------------- /images/LSin_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/LSin_no_2D.png -------------------------------------------------------------------------------- /images/LSin_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/LSin_steps.png -------------------------------------------------------------------------------- /images/LSin_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/LSin_tubes.png -------------------------------------------------------------------------------- /images/Linas2_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linas2_no.png -------------------------------------------------------------------------------- /images/Linas_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linas_no.png -------------------------------------------------------------------------------- /images/Linear_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linear_no.png -------------------------------------------------------------------------------- /images/Magma_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Magma_no.png -------------------------------------------------------------------------------- /images/Root_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Root_no_2D.png -------------------------------------------------------------------------------- /images/Root_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Root_steps.png -------------------------------------------------------------------------------- /images/Root_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Root_tubes.png -------------------------------------------------------------------------------- /images/SinExp_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/SinExp_no.png -------------------------------------------------------------------------------- /images/Sin_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Sin_no_2D.png -------------------------------------------------------------------------------- /images/Sin_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Sin_steps.png -------------------------------------------------------------------------------- /images/Sin_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Sin_tubes.png -------------------------------------------------------------------------------- /images/Smooth_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Smooth_no.png -------------------------------------------------------------------------------- /images/Sqrt_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Sqrt_no_2D.png -------------------------------------------------------------------------------- /images/Sqrt_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Sqrt_steps.png -------------------------------------------------------------------------------- /images/Sqrt_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Sqrt_tubes.png -------------------------------------------------------------------------------- /images/Tanh_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Tanh_no_2D.png -------------------------------------------------------------------------------- /images/Tanh_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Tanh_steps.png -------------------------------------------------------------------------------- /images/Tanh_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Tanh_tubes.png -------------------------------------------------------------------------------- /images/fractint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/fractint.png -------------------------------------------------------------------------------- /images/0_3d_60_75_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/0_3d_60_75_v.png -------------------------------------------------------------------------------- /images/CoolWarm_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/CoolWarm_no.png -------------------------------------------------------------------------------- /images/Cubehelix_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Cubehelix_no.png -------------------------------------------------------------------------------- /images/CubicInv_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/CubicInv_no.png -------------------------------------------------------------------------------- /images/Cubic_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Cubic_no_2D.png -------------------------------------------------------------------------------- /images/Cubic_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Cubic_steps.png -------------------------------------------------------------------------------- /images/Cubic_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Cubic_tubes.png -------------------------------------------------------------------------------- /images/Gamma_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Gamma_no_2D.png -------------------------------------------------------------------------------- /images/Gamma_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Gamma_steps.png -------------------------------------------------------------------------------- /images/Gamma_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Gamma_tubes.png -------------------------------------------------------------------------------- /images/GreenSin_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenSin_no.png -------------------------------------------------------------------------------- /images/HSP_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/HSP_steps_2D.png -------------------------------------------------------------------------------- /images/HSP_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/HSP_tubes_2D.png -------------------------------------------------------------------------------- /images/Linas2_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linas2_no_2D.png -------------------------------------------------------------------------------- /images/Linas2_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linas2_steps.png -------------------------------------------------------------------------------- /images/Linas2_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linas2_tubes.png -------------------------------------------------------------------------------- /images/Linas_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linas_no_2D.png -------------------------------------------------------------------------------- /images/Linas_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linas_steps.png -------------------------------------------------------------------------------- /images/Linas_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linas_tubes.png -------------------------------------------------------------------------------- /images/Linear_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linear_no_2D.png -------------------------------------------------------------------------------- /images/Linear_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linear_steps.png -------------------------------------------------------------------------------- /images/Linear_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linear_tubes.png -------------------------------------------------------------------------------- /images/Magma_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Magma_no_2D.png -------------------------------------------------------------------------------- /images/Magma_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Magma_steps.png -------------------------------------------------------------------------------- /images/Magma_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Magma_tubes.png -------------------------------------------------------------------------------- /images/Quadratic_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Quadratic_no.png -------------------------------------------------------------------------------- /images/SinExp_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/SinExp_no_2D.png -------------------------------------------------------------------------------- /images/SinExp_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/SinExp_steps.png -------------------------------------------------------------------------------- /images/SinExp_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/SinExp_tubes.png -------------------------------------------------------------------------------- /images/Sin_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Sin_steps_2D.png -------------------------------------------------------------------------------- /images/Sin_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Sin_tubes_2D.png -------------------------------------------------------------------------------- /images/Smooth_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Smooth_no_2D.png -------------------------------------------------------------------------------- /images/Smooth_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Smooth_steps.png -------------------------------------------------------------------------------- /images/Smooth_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Smooth_tubes.png -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | gcc d.c -Wall -lm 3 | ./a.out 4 | chmod +x g.sh # run thru bash file 5 | ./g.sh 6 | -------------------------------------------------------------------------------- /images/17_3d_60_75_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/17_3d_60_75_v.png -------------------------------------------------------------------------------- /images/BlueCubicInv_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/BlueCubicInv_no.png -------------------------------------------------------------------------------- /images/CoolWarm_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/CoolWarm_no_2D.png -------------------------------------------------------------------------------- /images/CoolWarm_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/CoolWarm_steps.png -------------------------------------------------------------------------------- /images/CoolWarm_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/CoolWarm_tubes.png -------------------------------------------------------------------------------- /images/Cubehelix_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Cubehelix_no_2D.png -------------------------------------------------------------------------------- /images/Cubehelix_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Cubehelix_steps.png -------------------------------------------------------------------------------- /images/Cubehelix_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Cubehelix_tubes.png -------------------------------------------------------------------------------- /images/CubicInv_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/CubicInv_no_2D.png -------------------------------------------------------------------------------- /images/CubicInv_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/CubicInv_steps.png -------------------------------------------------------------------------------- /images/CubicInv_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/CubicInv_tubes.png -------------------------------------------------------------------------------- /images/Cubic_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Cubic_steps_2D.png -------------------------------------------------------------------------------- /images/Cubic_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Cubic_tubes_2D.png -------------------------------------------------------------------------------- /images/Gamma_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Gamma_steps_2D.png -------------------------------------------------------------------------------- /images/Gamma_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Gamma_tubes_2D.png -------------------------------------------------------------------------------- /images/GreenCubic_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubic_no.png -------------------------------------------------------------------------------- /images/GreenSin_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenSin_no_2D.png -------------------------------------------------------------------------------- /images/GreenSin_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenSin_steps.png -------------------------------------------------------------------------------- /images/GreenSin_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenSin_tubes.png -------------------------------------------------------------------------------- /images/LSin_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/LSin_steps_2D.png -------------------------------------------------------------------------------- /images/LSin_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/LSin_tubes_2D.png -------------------------------------------------------------------------------- /images/Linas2_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linas2_steps_2D.png -------------------------------------------------------------------------------- /images/Linas2_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linas2_tubes_2D.png -------------------------------------------------------------------------------- /images/Linas_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linas_steps_2D.png -------------------------------------------------------------------------------- /images/Linas_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linas_tubes_2D.png -------------------------------------------------------------------------------- /images/Linear_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linear_steps_2D.png -------------------------------------------------------------------------------- /images/Linear_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Linear_tubes_2D.png -------------------------------------------------------------------------------- /images/Magma_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Magma_steps_2D.png -------------------------------------------------------------------------------- /images/Magma_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Magma_tubes_2D.png -------------------------------------------------------------------------------- /images/Quadratic_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Quadratic_no_2D.png -------------------------------------------------------------------------------- /images/Quadratic_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Quadratic_steps.png -------------------------------------------------------------------------------- /images/Quadratic_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Quadratic_tubes.png -------------------------------------------------------------------------------- /images/RainbowHSP_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowHSP_no.png -------------------------------------------------------------------------------- /images/RainbowHSV_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowHSV_no.png -------------------------------------------------------------------------------- /images/RedCubicInv_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RedCubicInv_no.png -------------------------------------------------------------------------------- /images/Root_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Root_steps_2D.png -------------------------------------------------------------------------------- /images/Root_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Root_tubes_2D.png -------------------------------------------------------------------------------- /images/SinExp_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/SinExp_steps_2D.png -------------------------------------------------------------------------------- /images/SinExp_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/SinExp_tubes_2D.png -------------------------------------------------------------------------------- /images/Smooth_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Smooth_steps_2D.png -------------------------------------------------------------------------------- /images/Smooth_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Smooth_tubes_2D.png -------------------------------------------------------------------------------- /images/Sqrt_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Sqrt_steps_2D.png -------------------------------------------------------------------------------- /images/Sqrt_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Sqrt_tubes_2D.png -------------------------------------------------------------------------------- /images/Tanh_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Tanh_steps_2D.png -------------------------------------------------------------------------------- /images/Tanh_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Tanh_tubes_2D.png -------------------------------------------------------------------------------- /images/CoolWarm_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/CoolWarm_steps_2D.png -------------------------------------------------------------------------------- /images/CoolWarm_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/CoolWarm_tubes_2D.png -------------------------------------------------------------------------------- /images/CubicInv_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/CubicInv_steps_2D.png -------------------------------------------------------------------------------- /images/CubicInv_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/CubicInv_tubes_2D.png -------------------------------------------------------------------------------- /images/GreenCubicInv_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubicInv_no.png -------------------------------------------------------------------------------- /images/GreenCubicRoot_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubicRoot_no.png -------------------------------------------------------------------------------- /images/GreenCubic_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubic_no_2D.png -------------------------------------------------------------------------------- /images/GreenCubic_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubic_steps.png -------------------------------------------------------------------------------- /images/GreenCubic_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubic_tubes.png -------------------------------------------------------------------------------- /images/GreenSin_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenSin_steps_2D.png -------------------------------------------------------------------------------- /images/GreenSin_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenSin_tubes_2D.png -------------------------------------------------------------------------------- /images/RainbowHSP_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowHSP_no_2D.png -------------------------------------------------------------------------------- /images/RainbowHSP_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowHSP_steps.png -------------------------------------------------------------------------------- /images/RainbowHSP_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowHSP_tubes.png -------------------------------------------------------------------------------- /images/RainbowHSV_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowHSV_no_2D.png -------------------------------------------------------------------------------- /images/RainbowHSV_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowHSV_steps.png -------------------------------------------------------------------------------- /images/RainbowHSV_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowHSV_tubes.png -------------------------------------------------------------------------------- /images/RedCubicInv_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RedCubicInv_no_2D.png -------------------------------------------------------------------------------- /images/RedCubicInv_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RedCubicInv_steps.png -------------------------------------------------------------------------------- /images/RedCubicInv_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RedCubicInv_tubes.png -------------------------------------------------------------------------------- /images/BlueCubicInv_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/BlueCubicInv_no_2D.png -------------------------------------------------------------------------------- /images/BlueCubicInv_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/BlueCubicInv_steps.png -------------------------------------------------------------------------------- /images/BlueCubicInv_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/BlueCubicInv_tubes.png -------------------------------------------------------------------------------- /images/Cubehelix_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Cubehelix_steps_2D.png -------------------------------------------------------------------------------- /images/Cubehelix_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Cubehelix_tubes_2D.png -------------------------------------------------------------------------------- /images/GreenCubicInv_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubicInv_no_2D.png -------------------------------------------------------------------------------- /images/GreenCubicInv_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubicInv_steps.png -------------------------------------------------------------------------------- /images/GreenCubicInv_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubicInv_tubes.png -------------------------------------------------------------------------------- /images/GreenCubicRoot_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubicRoot_no_2D.png -------------------------------------------------------------------------------- /images/GreenCubicRoot_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubicRoot_steps.png -------------------------------------------------------------------------------- /images/GreenCubicRoot_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubicRoot_tubes.png -------------------------------------------------------------------------------- /images/GreenCubic_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubic_steps_2D.png -------------------------------------------------------------------------------- /images/GreenCubic_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubic_tubes_2D.png -------------------------------------------------------------------------------- /images/Quadratic_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Quadratic_steps_2D.png -------------------------------------------------------------------------------- /images/Quadratic_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/Quadratic_tubes_2D.png -------------------------------------------------------------------------------- /images/RainbowHSP_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowHSP_steps_2D.png -------------------------------------------------------------------------------- /images/RainbowHSP_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowHSP_tubes_2D.png -------------------------------------------------------------------------------- /images/RainbowHSV_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowHSV_steps_2D.png -------------------------------------------------------------------------------- /images/RainbowHSV_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowHSV_tubes_2D.png -------------------------------------------------------------------------------- /images/RedCubicInv_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RedCubicInv_steps_2D.png -------------------------------------------------------------------------------- /images/RedCubicInv_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RedCubicInv_tubes_2D.png -------------------------------------------------------------------------------- /images/coolwarm3dRGB_60_75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/coolwarm3dRGB_60_75.png -------------------------------------------------------------------------------- /images/BlueCubicInv_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/BlueCubicInv_steps_2D.png -------------------------------------------------------------------------------- /images/BlueCubicInv_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/BlueCubicInv_tubes_2D.png -------------------------------------------------------------------------------- /images/GreenCubicInv_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubicInv_steps_2D.png -------------------------------------------------------------------------------- /images/GreenCubicInv_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubicInv_tubes_2D.png -------------------------------------------------------------------------------- /images/RainbowFractalizer_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowFractalizer_no.png -------------------------------------------------------------------------------- /images/GreenCubicRoot_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubicRoot_steps_2D.png -------------------------------------------------------------------------------- /images/GreenCubicRoot_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/GreenCubicRoot_tubes_2D.png -------------------------------------------------------------------------------- /images/OrangeBlueFractalizer_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/OrangeBlueFractalizer_no.png -------------------------------------------------------------------------------- /images/RainbowFractalizer_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowFractalizer_no_2D.png -------------------------------------------------------------------------------- /images/RainbowFractalizer_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowFractalizer_steps.png -------------------------------------------------------------------------------- /images/RainbowFractalizer_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowFractalizer_tubes.png -------------------------------------------------------------------------------- /images/OrangeBlueFractalizer_no_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/OrangeBlueFractalizer_no_2D.png -------------------------------------------------------------------------------- /images/OrangeBlueFractalizer_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/OrangeBlueFractalizer_steps.png -------------------------------------------------------------------------------- /images/OrangeBlueFractalizer_tubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/OrangeBlueFractalizer_tubes.png -------------------------------------------------------------------------------- /images/RainbowFractalizer_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowFractalizer_steps_2D.png -------------------------------------------------------------------------------- /images/RainbowFractalizer_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/RainbowFractalizer_tubes_2D.png -------------------------------------------------------------------------------- /images/OrangeBlueFractalizer_steps_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/OrangeBlueFractalizer_steps_2D.png -------------------------------------------------------------------------------- /images/OrangeBlueFractalizer_tubes_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adammaj1/1D-RGB-color-gradient/HEAD/images/OrangeBlueFractalizer_tubes_2D.png -------------------------------------------------------------------------------- /doc/TODO.md: -------------------------------------------------------------------------------- 1 | * [Hypnotizing Translucent Waves In 19th Century Russian Paintings Capture The Raw Power Of The Sea by Martynas Klimas](https://www.boredpanda.com/mesmerizing-translucent-waves-19th-century-painting-ivan-konstantinovich-aivazovsky/) 2 | * [highlighting of boundary](https://fractalforums.org/programming/11/cellular-coloring-of-mandelbrot-insides/3264) 3 | -------------------------------------------------------------------------------- /src/g.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # script file for BASH 4 | # which bash 5 | # save this file as g.sh 6 | # chmod +x g.sh 7 | # ./g.sh 8 | # checked in https://www.shellcheck.net/ 9 | 10 | 11 | 12 | # for all ppm files in this directory 13 | for file in *.ppm ; do 14 | # b is name of file without extension 15 | b=$(basename "$file" .ppm) 16 | # convert using ImageMagic 17 | convert "${b}".ppm "${b}".png 18 | echo "$file" 19 | done 20 | 21 | 22 | printf "delete all ppm files \n" 23 | rm ./*.ppm 24 | 25 | echo OK 26 | # end 27 | 28 | 29 | echo OK 30 | 31 | printf "info about software \n" 32 | bash --version 33 | make -v 34 | gcc --version 35 | gnuplot --version 36 | convert -version 37 | convert -list resource 38 | 39 | -------------------------------------------------------------------------------- /src/simplest_regression.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # copyright 2012, P. Lutus 5 | # released under the GPL 6 | 7 | import scipy 8 | import matplotlib.pyplot as plt 9 | 10 | # these are the sample points from my Web page 11 | 12 | xdata = scipy.array([-1,0,1,2,3,5,7,9]) 13 | ydata = scipy.array([-1,3,2.5,5,4,2,5,4]) 14 | 15 | # set the degree of the fit 16 | degree = len(xdata)-1 17 | 18 | # compute the coefficient list 19 | coeffs = scipy.polyfit(xdata,ydata,degree).tolist() 20 | 21 | # create a function to compute polynomial results 22 | yfit = lambda x: scipy.polyval(coeffs, x) 23 | 24 | # create a range for the polynomial fit 25 | x = scipy.arange(-1,9.2,.1) 26 | 27 | # show the original data points as red dots 28 | plt.plot(xdata,ydata,'o',color='r') 29 | 30 | # show the polynomial fit as a green line 31 | plt.plot(x,yfit(x)) 32 | 33 | # include a grid 34 | plt.grid(True) 35 | 36 | #save the result as a file 37 | plt.savefig('simplest_regression.png') 38 | 39 | # show the result 40 | plt.show() 41 | -------------------------------------------------------------------------------- /doc/colorwheel.md: -------------------------------------------------------------------------------- 1 | [Color wheel](https://en.wikipedia.org/wiki/Color_wheel) 2 | - [Twelve basic colors in a circle, studied on the lightest to the darkest gradation](https://de.123rf.com/photo_27328410_farbkreis-hell-dunkel-zw%C3%B6lf-grundfarben-in-einem-kreis-studierte-an-der-hellsten-bis-zum-dunkelsten-abs.html) 3 | - [circle is divided into n sectors varying in hue. Each sector is divided into m levels along radial dimension varying in lightnes](https://www.researchgate.net/publication/327268876_Interior_Color_and_Psychological_Functioning_in_a_University_Residence_Hall) 4 | * https://theblog.adobe.com/the-power-of-the-palette-why-color-is-key-in-data-visualization-and-how-to-use-it/ 5 | * https://opendarkroom.com/color-wheel-rendering/ 6 | * https://stackoverflow.com/questions/21490210/how-to-plot-a-colour-wheel-by-using-ggplot 7 | * http://sape.inf.usi.ch/quick-reference/ggplot2/colour 8 | * https://stackoverflow.com/questions/10289279/converting-hsv-circle-code-from-delphi-to-c-sharp 9 | * http://color.support/huecircle.html 10 | * https://weallsew.com/color-wheel-basics/ 11 | * http://www.printernational.org/rgb-versus-cmyk.php 12 | * https://www.thomasheller.net/creating-a-svg-color-wheel/ 13 | * https://opendarkroom.com/color-wheel-rendering/ 14 | * [The CIELAB hue wheel by Billy Biggs ](http://scanline.ca/hue/cielab.html) 15 | 16 | 17 | # algorithm 18 | * [SO question: what-is-the-math-behind-the-colour-wheel](https://stackoverflow.com/questions/4235072/what-is-the-math-behind-the-colour-wheel) 19 | 20 | 21 | 22 | ## code 23 | * [rosetta code](https://rosettacode.org/wiki/Color_wheel) 24 | * [github topics ](https://github.com/topics/color-wheel) 25 | * [c# by Rod Stephens](http://csharphelper.com/blog/2015/09/draw-a-colorful-color-wheel-in-c/) 26 | * [opengl](https://people.eecs.ku.edu/~jrmiller/Courses/OpenGL/SampleProgramSet2/SampleProgramSet2.html) 27 | * [color-wheel-renderer](https://github.com/jamesthurley/color-wheel-renderer) in TypeScript by Jamest Hurley 28 | 29 | colorwheel 30 | * angle = hue 31 | * radius = saturation 32 | * value is const 33 | -------------------------------------------------------------------------------- /src/plot.gp: -------------------------------------------------------------------------------- 1 | # save as a plot.gp 2 | # run : gnuplot plot.gp 3 | 4 | # Set the output file type 5 | set terminal png 6 | 7 | # list of gradient names; update it maually 8 | # gnuplot array is numbered from 1 to words(array), not like c arrays 9 | # use s.c program to update lists from titles and sGradientJoiningType arrays 10 | 11 | titles = "RainbowHSV Linas Linas2 RainbowFractalizer OrangeBlueFractalizer RainbowHSP HSP Magma Cubehelix CoolWarm GreenCubic GreenCubicInv GreenCubicRoot BlueCubicInv RedCubicInv GreenSin Linear Quadratic Cubic CubicInv Sqrt Root Gamma LSin SinExp Sin Smooth Tanh" 12 | 13 | sGradientJoiningType = "no steps tubes " 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | # length of array titles = nMax, but tex files are numbered from 0 to nMax-1 ( c style) 22 | nMax = words(titles) -1 23 | jMax = words(sGradientJoiningType) -1 24 | 25 | 26 | # legend 27 | set key inside bottom center horizontal 28 | set key horizontal 29 | set key font ",8" 30 | 31 | # remove upper and right axis 32 | set border 3 back 33 | set xtics nomirror out 34 | set ytics nomirror 35 | 36 | 37 | set xlabel "gradient position" 38 | set ylabel "color channel intensity" 39 | 40 | # adjust y range to make a space for the legend 41 | set yrange [-0.2:1.1] 42 | 43 | 44 | # plot nMax images 45 | # https://stackoverflow.com/questions/14946530/loop-structure-inside-gnuplot 46 | 47 | do for [n=0:nMax]{ 48 | 49 | do for [j=0:jMax] { 50 | # Set the output file name 51 | outfile = sprintf('%s_%s_2D.png',word(titles,n+1), word(sGradientJoiningType, j+1)) 52 | set output outfile 53 | 54 | # Set the intput file name 55 | infile = sprintf('%s_%s.txt',word(titles,n+1), word(sGradientJoiningType, j+1)) 56 | 57 | # title of the image for the array of strings 58 | sTitle = sprintf(" 2D RGB profiles of the %s colormap with %s GradientJoiningType", word(titles,n+1), word(sGradientJoiningType, j+1) ) 59 | set title sTitle 60 | 61 | # Now plot the data with lines and points 62 | plot infile using 1:2 with lines linecolor rgb 'red' title 'R', \ 63 | '' using 1:3 w lines linecolor rgb 'green' title 'G', \ 64 | '' using 1:4 w lines linecolor rgb 'blue' title 'B',\ 65 | '' using 1:5 w lines linecolor rgb 'black' title 'Y' 66 | 67 | 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/s.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | create enum from array of strings 4 | lazy and naive method 5 | 6 | 7 | gcc s.c -Wall 8 | ./a.out 9 | 10 | 11 | typedef enum {RainbowHSV , Linas , Linas2 , RainbowFractalizer , OrangeBlueFractalizer , RainbowHSP , HSP , Magma , Cubehelix , CoolWarm , Green , Linear , Quadratic , Cubic , Sqrt , Gamma , LSine , SineExp , Sine , Smooth } ColorTransferFunctionType; 12 | 13 | typedef enum {no = 0, steps = 1, tubes = 2} GradientJoiningType; 14 | 15 | 16 | 17 | titles = "RainbowHSV Linas Linas2 RainbowFractalizer OrangeBlueFractalizer RainbowHSP HSP Magma Cubehelix CoolWarm Green Linear Quadratic Cubic Sqrt Gamma LSine SineExp Sine Smooth " 18 | 19 | sGradientJoiningType = "no steps tubes " 20 | 21 | 22 | 23 | */ 24 | 25 | 26 | #include 27 | #include // malloc 28 | #include // strcat 29 | 30 | 31 | 32 | 33 | const char *titles[] = { 34 | /* multihue */ "RainbowHSV","Linas","Linas2","RainbowFractalizer", "OrangeBlueFractalizer", "RainbowHSP", "HSP", "Magma","Cubehelix", "CoolWarm", 35 | /* single hue */ "Green", 36 | /* gray */ "Linear","Quadratic","Cubic","Sqrt", "Gamma", "LSine", "SineExp", "Sine" , "Smooth"}; 37 | 38 | const char * sGradientJoiningType[] = {"no" , "steps" , "tubes"}; 39 | 40 | // print enum type 41 | void PrintEnums(){ 42 | 43 | // titles 44 | int i = 0; 45 | int iMax = sizeof(titles)/ sizeof(titles[0]); 46 | printf("typedef enum {"); 47 | for (i =0; i< iMax; ++i){ 48 | printf("%s ", titles[i]); 49 | if ( i{,{}{,{}{,}}} 96 | # view is 60 rot_x, 30 rot_z, 1 scale, 1 scale_z 97 | rot_x = 70 98 | rot_z = 60 99 | set view rot_x,rot_z 100 | set view equal xyz # to get an orthographic projection with all of the axes scaled equally 101 | set xyplane at 0 # adjusts the position at which the xy plane is drawn in a 3D plot 102 | 103 | # Set the output file name 104 | outfile = sprintf('%d_3d_%d_%d_v.png',n, rot_x, rot_z) 105 | set output outfile 106 | 107 | 108 | 109 | # title of the image for the array of strings 110 | sTitle = sprintf("3D %s profile of the %s colormap", word(spaces,s), word(titles,n+1) ) 111 | set title sTitle 112 | 113 | # http://www.bersch.net/gnuplot-doc/linetypes,-colors,-and-styles.html 114 | # There are several ways to specify color when one plots using gnuplot. 115 | # Among them hex-string (like "#0000ff") and rgbvalue (like "256") 116 | # specification is very important. 117 | # here rgb value is computed 118 | rgb(r,g,b) = 65536*int(255*r) + 256*int(255*g) + int(255*b) 119 | 120 | 121 | 122 | 123 | # Now plot the data with lines and points 124 | set label "(0,0,0)" at -0.1,0,0 right 125 | #set label "0" at 1,-0.1,0 right 126 | #set label "1" at 1,+1.1,0 right 127 | #set label "2" at 0,1.1,0 right 128 | #set label "3" at 0,1,1 left 129 | #set label "4" at 0,0,1 left 130 | # set label "5" at 1,0,1 left 131 | #set label "6" at 1,0,0 left 132 | set label "(1,1,1)" at 1.1,1,1 left 133 | splot infile using 1:1:1 with lines lw 3 lc rgb 'gray',\ 134 | infile using 2:3:4:(rgb($2,$3,$4)) with points pt 7 ps 2 lc rgb variable ,\ 135 | '-' w p pt 7 ps 2 lc rgb 'black' 136 | 0 0 0 137 | 1 1 1 138 | e 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /src/arctic.gpf: -------------------------------------------------------------------------------- 1 | # Gnuplot colour map 2 | # cptutils 1.55, Mon Sep 1 00:02:16 2014 3 | 0.00000 0.17255 0.20784 0.38824 4 | 0.01110 0.18039 0.21176 0.39216 5 | 0.02220 0.18824 0.21961 0.40392 6 | 0.03330 0.19608 0.23137 0.41569 7 | 0.04440 0.20392 0.23529 0.41961 8 | 0.05560 0.21176 0.23922 0.42745 9 | 0.06670 0.21961 0.24706 0.43529 10 | 0.07780 0.22353 0.25490 0.44314 11 | 0.08890 0.23529 0.26667 0.45490 12 | 0.10000 0.24314 0.27451 0.46275 13 | 0.11110 0.25098 0.28235 0.47059 14 | 0.12220 0.25882 0.29020 0.47843 15 | 0.13330 0.26667 0.29412 0.48627 16 | 0.14440 0.27451 0.30588 0.49412 17 | 0.15560 0.28627 0.31765 0.50588 18 | 0.16670 0.29804 0.32941 0.51765 19 | 0.17780 0.30196 0.33333 0.52157 20 | 0.18890 0.31373 0.34510 0.53333 21 | 0.20000 0.32157 0.35294 0.54118 22 | 0.21110 0.33725 0.36863 0.55686 23 | 0.22220 0.34510 0.37647 0.56471 24 | 0.23330 0.35294 0.38824 0.57255 25 | 0.24440 0.36078 0.39608 0.58039 26 | 0.25560 0.37255 0.40784 0.59216 27 | 0.26670 0.38431 0.41961 0.60392 28 | 0.27780 0.40000 0.43529 0.61569 29 | 0.28890 0.41176 0.44706 0.62745 30 | 0.30000 0.41961 0.45882 0.63529 31 | 0.31110 0.43922 0.47451 0.64706 32 | 0.32220 0.45882 0.49020 0.65490 33 | 0.33330 0.48627 0.51373 0.66667 34 | 0.34440 0.50980 0.52941 0.67843 35 | 0.35560 0.52549 0.54510 0.68627 36 | 0.36670 0.54510 0.56078 0.69412 37 | 0.37780 0.56078 0.57647 0.70588 38 | 0.38890 0.58039 0.59608 0.70980 39 | 0.40000 0.60784 0.61961 0.72549 40 | 0.41110 0.62353 0.63137 0.73333 41 | 0.42220 0.63922 0.64706 0.74118 42 | 0.43330 0.65098 0.65882 0.74902 43 | 0.44440 0.66667 0.67451 0.75686 44 | 0.45560 0.68627 0.69020 0.76471 45 | 0.46670 0.70588 0.70980 0.77255 46 | 0.47780 0.71373 0.71765 0.78039 47 | 0.48890 0.72549 0.72941 0.78431 48 | 0.50000 0.73333 0.73725 0.79216 49 | 0.51110 0.74510 0.74902 0.79608 50 | 0.52220 0.75686 0.75686 0.80000 51 | 0.53330 0.76078 0.76471 0.80392 52 | 0.54440 0.76863 0.77255 0.80784 53 | 0.55560 0.77255 0.77255 0.80784 54 | 0.55560 0.58824 0.82353 0.51373 55 | 0.55780 0.60784 0.85098 0.51765 56 | 0.56000 0.61961 0.85490 0.52157 57 | 0.56220 0.63529 0.86275 0.52549 58 | 0.56440 0.64706 0.86275 0.52549 59 | 0.56670 0.65882 0.86667 0.52549 60 | 0.56890 0.66667 0.87059 0.52941 61 | 0.57110 0.68235 0.87451 0.52941 62 | 0.57330 0.69412 0.87843 0.52941 63 | 0.57560 0.70980 0.88627 0.53333 64 | 0.57780 0.72157 0.89020 0.53725 65 | 0.58000 0.72941 0.89020 0.53725 66 | 0.58220 0.74118 0.89412 0.53725 67 | 0.58440 0.74902 0.89804 0.54118 68 | 0.58670 0.76471 0.90196 0.54118 69 | 0.58890 0.78039 0.90588 0.54510 70 | 0.59110 0.79216 0.90980 0.54510 71 | 0.59330 0.80392 0.91373 0.54902 72 | 0.59560 0.81176 0.91765 0.55294 73 | 0.59780 0.82353 0.92157 0.55294 74 | 0.60000 0.83922 0.92549 0.55686 75 | 0.60220 0.85490 0.92941 0.55686 76 | 0.60440 0.86275 0.93333 0.56078 77 | 0.60670 0.87059 0.93725 0.56078 78 | 0.60890 0.87843 0.93333 0.55686 79 | 0.61110 0.88235 0.92157 0.54510 80 | 0.61110 0.87843 0.92941 0.55294 81 | 0.62220 0.88235 0.92157 0.54510 82 | 0.63330 0.88627 0.91373 0.53725 83 | 0.64440 0.89020 0.89804 0.51765 84 | 0.65560 0.89412 0.89020 0.50980 85 | 0.66670 0.89804 0.88235 0.49804 86 | 0.67780 0.89804 0.87451 0.49020 87 | 0.68890 0.90196 0.86667 0.48235 88 | 0.70000 0.90588 0.85882 0.47059 89 | 0.71110 0.90980 0.85098 0.46667 90 | 0.72220 0.90980 0.83922 0.45490 91 | 0.73330 0.91765 0.82353 0.43922 92 | 0.74440 0.92157 0.81569 0.43137 93 | 0.75560 0.92549 0.80784 0.41961 94 | 0.76670 0.92549 0.80000 0.41176 95 | 0.77780 0.92941 0.79216 0.40784 96 | 0.78890 0.93333 0.78431 0.40000 97 | 0.80000 0.93725 0.77647 0.39216 98 | 0.81110 0.93725 0.76863 0.38431 99 | 0.82220 0.94118 0.75686 0.37255 100 | 0.83330 0.94510 0.74118 0.35686 101 | 0.84440 0.94118 0.73333 0.35294 102 | 0.85560 0.92157 0.72549 0.35294 103 | 0.86670 0.90588 0.71765 0.34902 104 | 0.87780 0.88627 0.70980 0.34902 105 | 0.88890 0.87059 0.70196 0.34902 106 | 0.90000 0.85490 0.69412 0.34902 107 | 0.91110 0.82353 0.67843 0.34902 108 | 0.92220 0.80000 0.67059 0.34902 109 | 0.93330 0.78431 0.66275 0.34902 110 | 0.94440 0.76863 0.65490 0.34902 111 | 0.95560 0.74902 0.64706 0.34902 112 | 0.96670 0.73333 0.63922 0.34902 113 | 0.97780 0.71765 0.63529 0.34902 114 | 0.98890 0.70196 0.62745 0.34902 115 | 1.00000 0.68235 0.61961 0.34902 116 | -------------------------------------------------------------------------------- /src/plot3d.gp: -------------------------------------------------------------------------------- 1 | # save as a cubehelix.gp 2 | # run : gnuplot cubehelix.gp 3 | # https://gitlab.com/adammajewski/color_gradient 4 | 5 | 6 | 7 | # Set the output file type 8 | set terminal png 9 | 10 | # list of gradient names; update it maually 11 | # gnuplot array is numbered from 1 to words(array), not like c arrays 12 | # update list with order as in function GiveColor from p.c 13 | titles = "Rainbow Linas Magma GrayL GrayNL2 GrayNL3 GraySqrt Green NewLinas CoolWarm GrayGamma GrayNL3Wave2 GrayNL3Wave10 GraySqrtWave ColorLWave ColorLWaveInverted NL3Wave5NonInv Cubehelix" 14 | spaces = "RGB HSV" 15 | 16 | 17 | # length of array spaces = nMax, but tex files are numbered from 0 to nMax-1 ( c style) 18 | nMax = words(spaces) 19 | 20 | 21 | # legend 22 | set key inside bottom center horizontal 23 | set key horizontal 24 | set key font ",8" 25 | 26 | # remove upper and right axis 27 | set border 3 back 28 | set xtics nomirror out 29 | set ytics nomirror 30 | 31 | 32 | set xlabel "gradient position" 33 | set ylabel " intensity" 34 | 35 | # adjust y range to make a space for the legend 36 | set yrange [-0.2:1.1] 37 | 38 | 39 | s=1 40 | 41 | # plot nMax images 42 | # https://stackoverflow.com/questions/14946530/loop-structure-inside-gnuplot 43 | 44 | do for [n=0:nMax] { 45 | 46 | print n 47 | print 2 48 | 49 | # Set the output file name 50 | outfile = sprintf('%d.png',n) 51 | set output outfile 52 | 53 | # Set the intput file name 54 | infile = sprintf('%d.txt',n) 55 | 56 | # title of the image for the array of strings 57 | sTitle = sprintf(" 2D %s profiles of the %s colormap", word(spaces,s), word(titles,n+1) ) 58 | set title sTitle 59 | 60 | 61 | 62 | 63 | # Now plot the data with lines and points 64 | plot infile using 1:2 with lines linecolor rgb 'red' title 'R', \ 65 | '' using 1:3 w lines linecolor rgb 'green' title 'G', \ 66 | '' using 1:4 w lines linecolor rgb 'blue' title 'B',\ 67 | '' using 1:5 w lines linecolor rgb 'black' title 'Y' 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | # 3d plot of rgb profile 81 | 82 | 83 | print 3 84 | 85 | 86 | set xlabel "R" 87 | set ylabel "G" 88 | set zlabel "B" 89 | 90 | unset yrange 91 | set nokey 92 | unset tics 93 | set xrange [0.0:1.0] 94 | set yrange [0.0:1.0] 95 | set zrange [0.0:1.0] 96 | set grid 97 | set border 4095 ls 1 lc rgb "black" # Draw a complete box around a `splot`: 98 | 99 | set xzeroaxis 100 | set yzeroaxis 101 | # set view {,{}{,{}{,}}} 102 | # view is 60 rot_x, 30 rot_z, 1 scale, 1 scale_z 103 | rot_x = 60 104 | rot_z = 75 105 | set view rot_x,rot_z 106 | set view equal xyz # to get an orthographic projection with all of the axes scaled equally 107 | set xyplane at 0 # adjusts the position at which the xy plane is drawn in a 3D plot 108 | 109 | # Set the output file name 110 | outfile = sprintf('%d_3d_%d_%d_v.png',n, rot_x, rot_z) 111 | set output outfile 112 | 113 | 114 | 115 | # title of the image for the array of strings 116 | sTitle = sprintf("3D %s profile of the %s colormap", word(spaces,s), word(titles,n+1) ) 117 | set title sTitle 118 | 119 | # http://www.bersch.net/gnuplot-doc/linetypes,-colors,-and-styles.html 120 | # There are several ways to specify color when one plots using gnuplot. 121 | # Among them hex-string (like "#0000ff") and rgbvalue (like "256") 122 | # specification is very important. 123 | # here rgb value is computed 124 | rgb(r,g,b) = 65536*int(255*r) + 256*int(255*g) + int(255*b) 125 | 126 | 127 | 128 | 129 | # Now plot the data with lines and points 130 | set label "(0,0,0)" at -0.1,0,0 right 131 | #set label "0" at 1,-0.1,0 right 132 | #set label "1" at 1,+1.1,0 right 133 | #set label "2" at 0,1.1,0 right 134 | #set label "3" at 0,1,1 left 135 | #set label "4" at 0,0,1 left 136 | # set label "5" at 1,0,1 left 137 | #set label "6" at 1,0,0 left 138 | set label "(1,1,1)" at 1.1,1,1 left 139 | splot infile using 1:1:1 with lines lw 3 lc rgb 'gray',\ 140 | infile using 2:3:4:(rgb($2,$3,$4)) with points pt 7 ps 2 lc rgb variable ,\ 141 | '-' w p pt 7 ps 2 lc rgb 'black' 142 | 0 0 0 143 | 1 1 1 144 | e 145 | 146 | 147 | } 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /src/plot2.gp: -------------------------------------------------------------------------------- 1 | # save as a plot2.gp 2 | # run : gnuplot plot2.gp 3 | 4 | 5 | 6 | set palette model HSV functions gray,1,1 7 | set cbrange [0:1] 8 | 9 | # Set the output file type 10 | set terminal png 11 | 12 | # list of gradient names; update it maually 13 | # gnuplot array is numbered from 1 to words(array), not like c arrays 14 | # update list with order as in function GiveColor from p.c 15 | titles = "Rainbow Linas Magma GrayL GrayNL2 GrayNL3 GraySqrt Green NewLinas CoolWarm GrayGamma GrayNL3Wave2 GrayNL3Wave10 GraySqrtWave ColorLWave ColorLWaveInverted NL3Wave5NonInv" 16 | spaces = "RGB HSV" 17 | 18 | 19 | # length of array spaces = nMax, but tex files are numbered from 0 to nMax-1 ( c style) 20 | nMax = words(spaces) 21 | 22 | 23 | # legend 24 | set key inside bottom center horizontal 25 | set key horizontal 26 | set key font ",8" 27 | 28 | # remove upper and right axis 29 | set border 3 back 30 | set xtics nomirror out 31 | set ytics nomirror 32 | 33 | 34 | set xlabel "gradient position" 35 | set ylabel " intensity" 36 | 37 | # adjust y range to make a space for the legend 38 | set yrange [-0.2:1.1] 39 | 40 | 41 | 42 | n=0 43 | 44 | 45 | 46 | # Set the output file name 47 | outfile = sprintf('%d.png',n) 48 | set output outfile 49 | 50 | # Set the intput file name 51 | infile = sprintf('%d.txt',0) 52 | 53 | # title of the image for the array of strings 54 | sTitle = sprintf(" %s profiles of the rainbow colormap", word(spaces,n) ) 55 | set title sTitle 56 | 57 | 58 | 59 | 60 | # Now plot the data with lines and points 61 | plot infile using 1:2 with lines linecolor rgb 'red' title 'R', \ 62 | '' using 1:3 w lines linecolor rgb 'green' title 'G', \ 63 | '' using 1:4 w lines linecolor rgb 'blue' title 'B',\ 64 | '' using 1:5 w lines linecolor rgb 'black' title 'Y' 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | # Set the output file name 73 | outfile = sprintf('%d_hsv.png',n) 74 | set output outfile 75 | 76 | # Set the intput file name 77 | infile = sprintf('%d.txt',0) 78 | 79 | # title of the image for the array of strings 80 | sTitle = sprintf(" %s profiles of the rainbow colormap", word(spaces,n) ) 81 | set title sTitle 82 | 83 | 84 | 85 | 86 | # Now plot the data with lines and points 87 | plot infile using 1:6 with lines linecolor rgb 'red' title 'H', \ 88 | '' using 1:7 w lines linecolor rgb 'green' title 'S', \ 89 | '' using 1:8 w lines linecolor rgb 'blue' title 'V' 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | # 3d plot of rgb profile 99 | 100 | 101 | 102 | 103 | set xlabel "R" 104 | set ylabel "G" 105 | set zlabel "B" 106 | 107 | unset yrange 108 | set nokey 109 | unset tics 110 | set xrange [0.0:1.0] 111 | set yrange [0.0:1.0] 112 | set zrange [0.0:1.0] 113 | set grid 114 | set border 4095 ls 1 lc rgb "black" # Draw a complete box around a `splot`: 115 | 116 | set xzeroaxis 117 | set yzeroaxis 118 | # set view {,{}{,{}{,}}} 119 | # view is 60 rot_x, 30 rot_z, 1 scale, 1 scale_z 120 | set view 60,75 121 | set view equal xyz # to get an orthographic projection with all of the axes scaled equally 122 | set xyplane at 0 # adjusts the position at which the xy plane is drawn in a 3D plot 123 | 124 | # Set the output file name 125 | outfile = sprintf('%d_3d_60_75_v.png',n) 126 | set output outfile 127 | 128 | 129 | 130 | # title of the image for the array of strings 131 | sTitle = sprintf("3D %s profile of the rainbow colormap", word(spaces,n+1) ) 132 | set title sTitle 133 | 134 | # http://www.bersch.net/gnuplot-doc/linetypes,-colors,-and-styles.html 135 | # There are several ways to specify color when one plots using gnuplot. 136 | # Among them hex-string (like "#0000ff") and rgbvalue (like "256") 137 | # specification is very important. 138 | # here rgb value is computed 139 | rgb(r,g,b) = 65536*int(255*r) + 256*int(255*g) + int(255*b) 140 | 141 | 142 | # http://gnuplot-surprising.blogspot.com/2012/10/ 143 | #convert dec color value to its hex string 144 | dec2hex(dec)=gprintf("%02x",dec) 145 | #convert rgb color value to its hex string 146 | rgb2hex(r,g,b)="#".\ 147 | dec2hex(255*r).\ 148 | dec2hex(255*g).\ 149 | dec2hex(255*b) 150 | 151 | 152 | 153 | # Now plot the data with lines and points 154 | set label "(0,0,0)" at -0.1,0,0 right 155 | #set label "0" at 1,-0.1,0 right 156 | #set label "1" at 1,+1.1,0 right 157 | #set label "2" at 0,1.1,0 right 158 | #set label "3" at 0,1,1 left 159 | #set label "4" at 0,0,1 left 160 | # set label "5" at 1,0,1 left 161 | #set label "6" at 1,0,0 left 162 | set label "(1,1,1)" at 1.1,1,1 left 163 | splot infile using 1:1:1 with lines lw 3 lc rgb 'gray',\ 164 | infile using 2:3:4:(rgb($2,$3,$4)) with points pt 7 ps 2 lc rgb variable ,\ 165 | '-' w p pt 7 ps 2 lc rgb 'black' 166 | 0 0 0 167 | 1 1 1 168 | e 169 | 170 | 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /doc/DICTIONARY.md: -------------------------------------------------------------------------------- 1 | Dictionary 2 | 3 | 4 | 5 | 6 | # color perception 7 | * [wikipedia](https://en.wikipedia.org/wiki/Color_vision) 8 | 9 | ## Paradox / illusions 10 | * [Checker shadow illusion](https://commons.wikimedia.org/wiki/File:Checker_shadow_illusion.svg) and [Grey square optical illusion proof2](https://commons.wikimedia.org/wiki/File:Grey_square_optical_illusion_proof2.svg) 11 | 12 | 13 | ## gamma correction 14 | 15 | # gamut 16 | 17 | 18 | # gradient/colourmap/palette 19 | * [color gradient](https://en.wikipedia.org/wiki/Color_gradient) is a set of colors arranged in a [linear order](https://en.wikipedia.org/wiki/Total_order) ( ordered) 20 | * palette : [In computer graphics, a palette is a finite set of colors](https://en.wikipedia.org/wiki/Palette_(computing)) [in no particular order](https://docs.gimp.org/en/gimp-palette-dialog.html) 21 | * Colorbar is a bar ( = broad shaft, or band, or stripe) that display the current colormap and indicate the mapping of data values into the colormap 22 | * Color transfer function 23 | * [a path](https://en.wikipedia.org/wiki/Path_(topology)) through [colour space](https://en.wikipedia.org/wiki/Color_space) 24 | * [Color mapping](https://en.wikipedia.org/wiki/Color_mapping) ( map) is a function that maps (transforms) the colors of one (source) image to the colors of another (target) image 25 | 26 | ![](./images/17_3d_60_75_v.png "Continous gradient as a path through RGB colour space ") 27 | 28 | 29 | 30 | # hue (dull to bright), 31 | * single hue = [monochromatic](https://en.wikipedia.org/wiki/Monochromatic_color) for the value of one numeric variable 32 | * multiple hue (polichromatic ) for the data that aren’t based on the value of a single number ( categories) 33 | * [two hue = divergent](https://learnui.design/blog/picking-colors-for-your-data-visualizations.html) 34 | 35 | 36 | 37 | # saturation ( chroma) 38 | 39 | 40 | # Lightness ( from black to white) 41 | * [How to Determine Lightness by Reda Lemeden](https://thoughtbot.com/blog/closer-look-color-lightness#how-to-determine-lightness) 42 | * [stackoverflow question: formula-to-determine-brightness-of-rgb-color](https://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color) 43 | * desaturation = Converting color to [grayscale](https://en.wikipedia.org/wiki/Grayscale) 44 | * [Three algorithms for converting color to grayscale by John D. Cook](https://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/) 45 | * [gimp 2.6 doc](https://docs.gimp.org/2.6/en/gimp-tool-desaturate.html) 46 | * [stackoverflow question : Standard-rgb-to-grayscale-conversion](https://stackoverflow.com/questions/17615963/standard-rgb-to-grayscale-conversion) 47 | * [Conversion to grayscale by Jason Summers](https://entropymine.com/imageworsener/grayscale/) 48 | 49 | [Relative luminance is formed as a weighted sum of linear RGB components](https://en.wikipedia.org/wiki/Luma_(video)) 50 | 51 | 52 | ```c 53 | //from function test_palette_subcommand from the file gnuplot/src/command.c 54 | ntsc = 0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.b; 55 | ``` 56 | 57 | [Photoshop](https://github.com/XiaoXiaoLui/photoshop_hsl_plugin) 58 | ``` 59 | y = 0.30 * r + 0.59 * g + 0.11 * b; 60 | ``` 61 | 62 | Perceived brightness ( P from HSP ) by [Darel Rex Finley](http://alienryderflex.com/hsp.html) 63 | >>> 64 | By playing around with Photoshop’s RGB-to-Greyscale mode conversion, I determined that it is doing something very close to this: 65 | 66 | brightness = sqrt( .299 R^2 + .587 G^2 + .114 B^2 ) 67 | >>> 68 | 69 | 70 | 71 | ## Cielab lightness 72 | * RGB -> XYZ -> Celab 73 | * [easyrgb](http://www.easyrgb.com/en/math.php#text2) 74 | * in OpenCV source /src/cv/cvcolor.cpp there are functions for color space conversions: [icvBGRx2Lab_32f_CnC3R](https://github.com/cybertk/opencv/blob/master/opencv/cv/src/cvcolor.cpp) 75 | * [python code by Manoj Pandey](https://gist.github.com/manojpandey/f5ece715132c572c80421febebaf66ae) 76 | 77 | 78 | 79 | # Contrast 80 | * https://en.wikipedia.org/wiki/Contrast_(vision) 81 | * [LUMINANCE CONTRAST IN COLOR GRAPHICS by NASA](https://colorusage.arc.nasa.gov/design_lum_1.php) 82 | 83 | 84 | 85 | # colour spaces 86 | * [perceptualu uniform](https://programmingdesignsystems.com/color/perceptually-uniform-color-spaces/): 87 | * CIELAB color space for the characterization of colored surfaces and dyes 88 | * CIELUV color space for the characterization of color displays 89 | * [HSLUV](http://www.hsluv.org/) and [hsluv-c](https://github.com/hsluv/hsluv-c) 90 | * [Kodak ProPhoto RGB, Adobe RGB (1998) and sRGB are examples of gray balanced and perceptually uniform RGB working color space ](http://colormanaging.blogspot.com/2010/12/ideal-color-space.html) 91 | * [Gray balanced means that equal RGB numbers always produce a neutral gray ](http://colormanaging.blogspot.com/2010/12/ideal-color-space.html) 92 | * [HSP by Darel Rex Finley](http://alienryderflex.com/hsp.html) 93 | 94 | 95 | 96 | 97 | 98 | # data types 99 | * qualitative/quantitative 100 | * ordered/non-ordered 101 | * numerical/categorical(=non-numerical) 102 | * numerical data subtypes: discrete, continuous, interval, ratio 103 | 104 | 105 | ## Qualitative/Quantitative 106 | * [Qualitative = can not be measured with a numerical result](https://en.wikipedia.org/wiki/Qualitative_property), needs discrete palette with distinctive colors 107 | * Quantitative = can be measured with a numerical result. Needs continous palette ( sequential) 108 | 109 | see also : 110 | * descriptive like [descriptive color palettes](https://colors.lol/) 111 | 112 | 113 | 114 | ## ordered/not-ordered data 115 | * ordered 116 | * continous ( numerical , real numbers) 117 | * sequential = discrete ( numerical, integer). See sequential palettes from Color Brewer 118 | * not ordered = qualitative, discrete not ordered 119 | 120 | ## Data and gradient relation: 121 | * continous gradient for numeric real type data 122 | * [Sequential](https://carto.com/carto-colors/) (discrete) color gradient for orderable or numeric integer data, like gradients from the Color Brewer library. ["a series of ordered colors to represent ordinal or numerical data."](https://onlinelibrary.wiley.com/doi/abs/10.1002/col.22212) 123 | * [color scale](https://www.vis4.net/blog/2013/09/mastering-multi-hued-color-scales/) 124 | * [colour scheme](https://en.wikipedia.org/wiki/Color_scheme) is the choice of colors used in design for a range of media ( www, ) 125 | * Qualitative schemes: categorical differences in qualitative data 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /doc/LINKS.md: -------------------------------------------------------------------------------- 1 | Links 2 | 3 | 4 | 5 | 6 | # Programs 7 | 8 | 9 | 10 | ## gimp 11 | * [gimp palette-dialog ](https://docs.gimp.org/en/gimp-palette-dialog.html) 12 | ## gnuplot 13 | * [wikibooks](https://en.wikibooks.org/wiki/Gnuplot/palette) 14 | * [gnuplot demo script: pm3dcolors.dem](http://gnuplot.sourceforge.net/demo/pm3dcolors.html) 15 | * [gnuplot palletes: ](https://github.com/Gnuplotting/gnuplot-palettes) 16 | 17 | ## Imagemagic 18 | * [color gradient](https://imagemagick.org/script/gradient.php) 19 | 20 | ## python colormaps 21 | * [Fast and easy discrete and continuous colormaps by Nelen & Schuurmans](https://github.com/nens/colormaps) 22 | * [colorio](https://pypi.org/project/colorio/) - tools for color models 23 | * [Colour Science for Python ](https://github.com/colour-science/colour) 24 | * [Palettable = Color palettes for Python by Matt Davis](https://jiffyclub.github.io/palettable/) 25 | * [A full implementation of Dave Green's "cubehelix" colormap for Python by James Davenport](https://github.com/jradavenport/cubehelix) 26 | * [python colormaps](http://www-personal.umich.edu/~mejn/computational-physics/colormaps.py) 27 | * [BIDS/colormap](https://github.com/bids/colormap) 28 | * [paraview](https://gitlab.kitware.com/paraview/paraview/blob/master/Wrapping%2FPython%2Fparaview%2F_colorMaps.py) 29 | * [Berkeley Institute for Data Science colormaps](https://github.com/BIDS/colormap/blob/master/colormaps.py) 30 | * [scivis color](https://sciviscolor.org/resources/) 31 | * [Colorcet](https://colorcet.holoviz.org/) 32 | * [pyvista cmap choices](https://docs.pyvista.org/examples/02-plot/cmap.html) 33 | * [A Better Default Colormap for Matplotlib | SciPy 2015 | Nathaniel Smith and Stéfan van der Walt](https://www.youtube.com/watch?v=xAoljeRJ3lU) 34 | * [mpl colormaps](https://bids.github.io/colormap/) 35 | 36 | 37 | 38 | ## Photoshop 39 | * [what-is-the-mathmatical-formula-of-gradient-map](https://community.adobe.com/t5/photoshop/what-is-the-mathmatical-formula-of-gradient-map/td-p/10502214?page=1) 40 | 41 | ## Processing 42 | * [color-gradients-in-processing by Jeremy Behreandt](https://medium.com/@behreajj/color-gradients-in-processing-v-2-0-e5c0b87cdfd2) 43 | 44 | ## Octave/matlab 45 | * [Origins of Colormaps Posted by Cleve Moler, February 2, 2015](https://blogs.mathworks.com/cleve/2015/02/02/origins-of-colormaps/) 46 | * [Color Image Processing by Gabriel Peyre](https://www.numerical-tours.com/matlab/multidim_1_color/) 47 | 48 | ## R 49 | * [colorspace](http://colorspace.r-forge.r-project.org/articles/colorspace.html) 50 | * [munsellinterpol by Glenn Davis and Jose Gama](https://cran.r-project.org/web/packages/munsellinterpol/vignettes/munsellinterpol-guide.html) 51 | * [pals by Kevin Wright](https://kwstat.github.io/pals/) 52 | * [cetcolor by James Balamuta and Peter Kovesi](https://github.com/coatless/cetcolor) 53 | * [r-color-palettes](https://github.com/EmilHvitfeldt/r-color-palettes) 54 | * [ggplot](https://www.r-bloggers.com/a-detailed-guide-to-ggplot-colors/) 55 | 56 | ## Ruby 57 | * [Library for dealing with color gradients in ruby by Zee V. (Philip)](https://github.com/zeeraw/gradient) 58 | 59 | ## Stata 60 | * [palette](http://repec.sowi.unibe.ch/stata/palettes/colors.html) 61 | 62 | # People 63 | * [Peter Kovesi](https://www.peterkovesi.com/) 64 | * [Perceptually Uniform Colour Maps](https://peterkovesi.com/projects/colourmaps/) 65 | * [matlab functions](https://www.peterkovesi.com/matlabfns/index.html#colour) 66 | * [Jim J Green](http://soliton.vm.bytemark.co.uk/pub/jjg/en/) 67 | * [Kenneth Moreland](http://www.kennethmoreland.com/) 68 | * [BadColorMaps](http://www.kennethmoreland.com/color-advice/BadColorMaps.pdf) 69 | * [Diverging Color Maps for Scientific Visualization](http://www.kennethmoreland.com/color-maps/) 70 | * [Colin Ware](https://ccom.unh.edu/vislab/colin_ware.html) 71 | * [Fabio Crameri](http://www.fabiocrameri.ch/colourmaps.php) 72 | * [Dave Green](http://www.mrao.cam.ac.uk/~dag/CUBEHELIX/#Other) 73 | * [Mathieu Jacomy](https://observablehq.com/@jacomyma) 74 | 75 | 76 | # www 77 | * [khan academy: color science by Pixar](https://www.khanacademy.org/partner-content/pixar/color) 78 | * [opencolorio](https://opencolorio.org/) 79 | * [colour-science.org](https://www.colour-science.org/) 80 | 81 | 82 | # Scientific articles 83 | * [Chasing Rainbows: A Color-Theoretic Framework for Improving and Preserving Bad Colormaps by Robert SisnerosMohammad RajiMohammad RajiMark W. Van MoerDavid Bock](https://www.researchgate.net/publication/311530664_Chasing_Rainbows_A_Color-Theoretic_Framework_for_Improving_and_Preserving_Bad_Colormaps) 84 | * [A Survey of Colormaps in Visualization by Liang Zhou and Charles D. Hansen. IEEE Trans Vis Comput Graph. 2016 Aug; 22(8): 2051–2069.](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4959790/) 85 | * [Using color in visualization: A survey by S Silva, BS Santos, J Madeira - Computers & Graphics, 2011 - Elsevier](https://visualization.sites.clemson.edu/reu/papers/paper1.pdf) 86 | * ["Escaping RGBland: Selecting colors for statistical graphics" by Achim Zeileis; Kurt Hornik; Paul Murrell. Computational Statistics & Data Analysis, ISSN: 0167-9473, Vol: 53, Issue: 9, Page: 3259-3270 Publication Year2009](https://eeecon.uibk.ac.at/~zeileis/papers/Zeileis+Hornik+Murrell-2009.pdf) 87 | * [SOMEWHERE OVER THE RAINBOW. How to Make Effective Use of Colors in Meteorological Visualizations by Reto Stauffer, Georg J. Mayr, Markus Dabernig, and Achim Zeileis](https://journals.ametsoc.org/doi/pdf/10.1175/BAMS-D-13-00155.1) 88 | * [Diverging Color Maps for Scientific Visualization (Expanded) by Kenneth Moreland](https://cfwebprod.sandia.gov/cfdocs/CompResearch/docs/ColorMapsExpanded.pdf) 89 | * [The Good, the Bad, and the Ugly: A Theoretical Framework for the Assessment of Continuous Colormaps by Roxana Bujack, Terece L. Turton, Francesca Samsel, Colin Ware ](https://datascience.dsscale.org/wp-content/uploads/2017/10/TheGoodtheBadandtheUgly.pdf) 90 | * [Color Sequences for Univariate Maps: Theory, Experiments and Principles by Colin Ware](https://ccom.unh.edu/sites/default/files/publications/Ware_1988_CGA_Color_sequences_univariate_maps.pdf) 91 | * [Categorical colour geometry by Lewis D. Griffin ,Dimitris Mylonas](https://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0216296&type=printable) 92 | * [ColorCAT: Guided Design of Colormaps for Combined Analysis Tasks](https://github.com/SebastianMittelstaedt/ColorCAT/blob/master/Paper.pdf) 93 | * [Measuring the Effects of Scalar and Spherical Colormaps on Ensembles of DMRI Tubes](https://arxiv.org/pdf/1810.07882.pdf) 94 | * [A rule-based tool for assisting colormap selection by Lawrence D. Bergman, Bernice E. Rogowitz, Lloyd Treinish](https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxiZXJuaWNlcm9nb3dpdHp8Z3g6NTZmMGI5ZGZkOWJjNjRhZA) 95 | * [Methods for Effective Color Encoding and the Compensation of Contrast Effects by Sebastian Mittelstädt](https://kops.uni-konstanz.de/bitstream/123456789/32378/3/Mittelstaedt_0-312940.pdf) 96 | * [P. Nardini, M. Chen, F. Samsel, R. Bujack, M. Böttinger and G. Scheuermann, "The Making of Continuous Colormaps," in IEEE Transactions on Visualization and Computer Graphics.](https://ieeexplore.ieee.org/abstract/document/8939459) 97 | * [ Sebastian, Dominik JÄCKLE, Florian STOFFEL, Daniel A. KEIM, 2015. ColorCAT : Guided Design of Colormaps for Combined Analysis Tasks.](https://kops.uni-konstanz.de/handle/123456789/32461) 98 | 99 | -------------------------------------------------------------------------------- /src/h.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 4 | c console program for testing color gradient 5 | uses a code from gnuplot 6 | 7 | 8 | gcc h.c -lm -Wall 9 | a@zelman:~/c/varia/outor/gradient/hsv$ ./a.out 10 | =========================== 11 | 12 | h= 360.000000 s=0.000000 v=1.000000 13 | r= 1.000000 g=1.000000 b=1.000000 14 | ----------------------------------- 15 | h= 0.000000 s=1.000000 v=1.000000 16 | r= 1.000000 g=0.000000 b=0.000000 17 | 18 | 19 | 20 | 21 | 22 | 23 | */ 24 | 25 | 26 | 27 | #include 28 | #include // strncat 29 | #include // malloc 30 | #include // floor; needs -lm also 31 | 32 | 33 | 34 | 35 | 36 | 37 | // size of virtual 2D array of pixels 38 | // each piexel has a RGB color 39 | int iWidth = 600; 40 | int iHeight ; // 41 | 42 | 43 | // size of the dynamic 1D array 44 | unsigned char * data; 45 | size_t ColorSize = 3; // RGB = number of color components = channels 46 | size_t ArrayLength; // number of 1D array's elements = ENumber = iWidth*iHeight*ColorSize 47 | size_t ElementSize; // size of array's element in bytes 48 | size_t ArraySize; // size of array in bytes = ElementSize*ArrayLength 49 | 50 | // ppm P6 file 51 | size_t HeaderSize ; // size of the P6 file header in bytes 52 | size_t FileSize; // = HeaderSize +ArraySize [bytes] 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | // gives position of 2D point (ix,iy) in 1D array ; uses also global variables: iWidth , ColorSize 61 | int Give_i ( int iX, int iY) 62 | { 63 | return (iX + iY * iWidth) * ColorSize; 64 | } 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | /* 73 | 74 | GNUPLOT : http://gnuplot.sourceforge.net/ 75 | file : getoutor.c 76 | 77 | * Petr Mikulik, December 1998 -- June 1999 78 | * Copyright: open source as much as possible 79 | * 80 | */ 81 | 82 | 83 | 84 | // from colour.h 85 | /* Contains a colour in RGB scheme. 86 | Values of r, g and b are all in range [0;1] */ 87 | typedef struct { 88 | double r, g, b; 89 | } rgb; 90 | 91 | /* hsv : 92 | h : deg [0,360] 93 | s : % [0.0,100.0] 94 | v : % [0.0,100] 95 | */ 96 | typedef struct { 97 | double h, s, v; 98 | } hsv; 99 | 100 | 101 | 102 | 103 | 104 | /* 105 | * outor Conversion Algorithms 106 | * taken from http://www.cs.rit.edu/~ncs/outor/t_convert.html 107 | * each outor model should provide a conversion to RGB. 108 | * RGB values are clipped to [0,1] as some outors in some 109 | * models have no RGB value. 110 | */ 111 | 112 | static void 113 | HSV_2_RGB(hsv in, rgb *out) 114 | { 115 | double h,s,v, f,p,q,t; 116 | int i; 117 | 118 | h = in.h; 119 | s = in.s; 120 | v = in.v; 121 | if (s == 0) { /* achromatic (gray) */ 122 | out->r = out->g = out->b = v; 123 | return; 124 | } 125 | 126 | h *= 6.; /* h range in gnuplot is [0,1] and not the usual [0,360] */ 127 | i = floor(h); 128 | f = h - i; 129 | p = v * (1.0 - s); 130 | q = v * (1.0 - s*f); 131 | t = v * (1.0 - s*(1.0-f)); 132 | switch(i % 6) { 133 | case 0: 134 | out->r = v; 135 | out->g = t; 136 | out->b = p; 137 | break; 138 | case 1: 139 | out->r = q; 140 | out->g = v; 141 | out->b = p; 142 | break; 143 | case 2: 144 | out->r = p; 145 | out->g = v; 146 | out->b = t; 147 | break; 148 | case 3: 149 | out->r = p; 150 | out->g = q; 151 | out->b = v; 152 | break; 153 | case 4: 154 | out->r = t; 155 | out->g = p; 156 | out->b = v; 157 | break; 158 | default: 159 | out->r = v; 160 | out->g = p; 161 | out->b = q; 162 | break; 163 | } 164 | } 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | void PrintColor( FILE *fp, double position, hsv in, rgb out){ 173 | // normalized to [0.0, 1.0] range RGB color channels 174 | double R = out.r; 175 | double G = out.g; 176 | double B = out.b; 177 | // [Relative luminance is formed as a weighted sum of linear RGB components](https://en.wikipedia.org/wiki/Luma_(video)) 178 | // 179 | //from function test_palette_subcommand from file gnuplot/src/command.c test_palette_subcommand 180 | //ntsc = 0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.b; 181 | double Y = 0.299*R + 0.587*G + 0.114*B; 182 | 183 | 184 | //print 185 | fprintf(fp, "%f\t", position); 186 | fprintf(fp, "%f\t %f\t%f\t%f\t", R, G, B, Y); 187 | fprintf(fp, "%f\t %f\t %f\n", in.h, in.s, in.v); 188 | 189 | 190 | 191 | 192 | } 193 | 194 | 195 | 196 | 197 | /* position -> hsv -> rgb 198 | input position double [0.0, 1.0] 199 | output rgb = unsigned char c array 200 | 201 | rainbow gradient = Rainbow colormap or sawtooth rainbow or hsv 202 | */ 203 | void ComputeAndPrintColor( FILE *fp, double position, unsigned char c[]){ 204 | 205 | // "cyclic colormap traversing HSV color space. The map is obtained by linearly varying the hue through all possible values while keeping constant maximum saturation and value." 206 | 207 | hsv in = {position, 1.0, 1.0}; // set palette model HSV functions gray,1,1 208 | rgb out; 209 | 210 | // compute hsv from position 211 | 212 | HSV_2_RGB(in, &out); // convert hsv to rgb 213 | 214 | // 215 | PrintColor( fp, position, in, out); 216 | 217 | // change range 218 | c[0] = 255*out.r; //R 219 | c[1] = 255*out.g; // G 220 | c[2] = 255*out.b; // B 221 | 222 | 223 | } 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | int PlotPoint(unsigned char A[], int i, unsigned char color[]){ 238 | 239 | A[i] = color[0]; /* Red*/ 240 | A[i+1] = color[1]; /* Green */ 241 | A[i+2] = color[2]; /* Blue */ 242 | return 0; 243 | 244 | 245 | } 246 | 247 | 248 | 249 | // -------------------- 250 | int FillArray (unsigned char A[] , int n){ 251 | 252 | int iX; 253 | int iXmax = iWidth; 254 | int iY; 255 | int iYmax = iHeight; 256 | int i; // index of 1D array 257 | double position; // number form 0.0 to 1.0 used for color gradient 258 | unsigned char color[3]; // 259 | 260 | // text file used by the gnuplot for creating images 261 | char name [100]; /* name of file */ 262 | snprintf(name, sizeof name, "%d", n); /* */ 263 | char *filename =strncat(name,".txt", 4); 264 | FILE *fp = fopen(filename, "w"); 265 | if (fp==NULL) { 266 | printf("Error opening text file!\n"); 267 | return 1; 268 | } 269 | fprintf(fp, "# position \t\t R \t\t G \t\tB \t\tY \t h\ts\tv\n"); // header of the text file 270 | 271 | 272 | // 273 | for(iX=0; iX