Changing transparency of individual bars in a barplot using CairoMakie

Hi, I am trying to generate a barplot using CairoMakie which would consist two sets of bars each with a different transparency. So far I am not sure how to achieve that.

MWE below depicts the barplot I am generating so far

import CairoMakie, Random;

n_A, n_B, n_C = 6, 2, 3;

fig = CairoMakie.Figure();
ax = CairoMakie.Axis(fig[1, 1],
        xlabel="xlabel", ylabel = "ylabel",
    );

barplot = let
    Random.seed!(0)
    data = rand(n_A, n_B * n_C)
    xs = repeat(1:n_A, n_B * n_C)
    dgd = repeat(repeat(1:n_B, inner=n_A), n_C)
    stk = clr = repeat(1:n_C, inner=n_A * n_B)
    CairoMakie.barplot!(
        ax,
        xs, data[:],
        dodge=dgd, stack=stk, color=clr,
        direction=:x,
    ) 
end;
display(fig)
CairoMakie.save("test.png", fig);

In this barplot there are six pairs of stacked bars and I would like to have one transparency for the first stacked bar of the pairs and another for the second. I would really appreciate if one could point me in the right direction.

I was able to achieve what I wanted using packages Colors and ColorSchemes. I extracted the colours using get() function to define a custom colormap which contains colours of two transparencies shown as below

import CairoMakie, Colors, ColorSchemes, Random;

n_A, n_B, n_C = 6, 2, 3;

fig = CairoMakie.Figure();
ax = CairoMakie.Axis(fig[1, 1],
        xlabel="xlabel", ylabel = "ylabel",
    );

barplot = let
    Random.seed!(0)
    data = rand(n_A, n_B * n_C)
    xs = repeat(1:n_A, n_B * n_C)
    dgd = repeat(repeat(1:n_B, inner=n_A), n_C)
    stk = repeat(1:n_C, inner=n_A * n_B)
    viridis = get(ColorSchemes.viridis, 1:n_buffers, (1, n_buffers))
    viridis_half = Colors.RGBA.(viridis, 0.5)
    custom_colormap = [viridis_half viridis]'[:]
    clr = repeat(custom_colormap, inner=6)
    CairoMakie.barplot!(
        ax,
        xs, data[:],
        dodge=dgd, stack=stk, color=clr,
        direction=:x,
    )
end;
display(fig)
CairoMakie.save("test.png", fig);

Though this solves the current issue, I was wondering if there is a cleaner and simpler way of achieving this.