@@ -392,6 +392,7 @@ function plot_interactive_impl(grid, states;
392392 " batlowK" ,
393393 " berlin" ,
394394 " brg" ,
395+ " commercial" ,
395396 " gnuplot" ,
396397 " gray1" ,
397398 " hawaii" ,
@@ -553,7 +554,6 @@ function plot_interactive_impl(grid, states;
553554 tri = primitives. triangulation
554555 scat = Makie. mesh! (ax, pts, tri; color = ys,
555556 colorrange = lims,
556- size = 60 ,
557557 backlight = 1 ,
558558 colormap = cmap,
559559 transparency = transparency,
@@ -675,7 +675,11 @@ function unpack(buffer, x::AbstractVector, ix)
675675end
676676
677677function generate_colormap (colormap_name, alphamap_name, base_alpha, low, high)
678- cmap = to_colormap (colormap_name)
678+ if colormap_name == :commercial
679+ cmap = commercial_colormap ()
680+ else
681+ cmap = to_colormap (colormap_name)
682+ end
679683 n = length (cmap)
680684 if alphamap_name != :no_alpha_map
681685 if alphamap_name == :linear
@@ -878,3 +882,27 @@ function Jutul.plotting_check_interactive(; warn = true)
878882 end
879883 return true
880884end
885+
886+ function commercial_colormap ()
887+ blue = (0 , 0 , 1 )
888+ cyan = (0 , 1 , 1 )
889+ green = (0 , 1 , 0 )
890+ yellow = (1 , 1 , 0 )
891+ red = (1 , 0 , 0 )
892+
893+ function simple_interp (F_0, F_1, x)
894+ v = F_0 .+ (F_1 .- F_0). * x
895+ return Makie. RGB (v... )
896+ end
897+ cmap = Vector {typeof(Makie.RGB(0, 0, 0))} ()
898+ nsteps = [30 , 25 , 25 , 20 ]
899+ colors = (blue, cyan, green, yellow, red)
900+ for (i, nstep) in enumerate (nsteps)
901+ c1 = colors[i]
902+ c2 = colors[i+ 1 ]
903+ for dx in range (0.0 , 1.0 , nstep)
904+ push! (cmap, simple_interp (c1, c2, dx))
905+ end
906+ end
907+ return cmap
908+ end
0 commit comments