I am trying to adapt this this question to change the ticks on a BarLegend so have a user-defined continuous BarLegend with ticks
This code allows me to define the ticks I want (sort of, how many compartments I choose does affect things)
BarLegend[{{RGBColor[1, 1, 1], RGBColor[0.3, 0.5, 0.9]}, {0, 1}}, 9,
LegendLayout -> "Row", Ticks -> Table[i, {i, 0, 1, 0.2}]]
but I need a continuous gradient, which can be achieved by choosing a high number of compartments, but then the tick labels disappear
BarLegend[{{RGBColor[1, 1, 1], RGBColor[0.3, 0.5, 0.9]}, {0, 1}}, 200,
LegendLayout -> "Row", Ticks -> Table[i, {i, 0, 1, 0.2}]]
I will not always have just 2 stops in the gradient.
I also tried to convert a LinearGradientImage into a BarLegend, but was not successful