If one wants to have pixels transparent (or semi-transparent), the following can be done:
return[1,0,0,0.5]
" for semi-transparent red pixel or "return[0,0,0,0]
" for full transparencyE.g. if one wants to have a Hollstein's cloud overview layer shown in a way, that everything except clouds is transparent, she just needs to change
let naturalColour = [B04, B03, B02].map(a => gain * a);
let CLEAR = naturalColour;
let SHADOW = naturalColour;
let WATER = [0.1,0.1,0.7];
let CIRRUS = [0.8,0.1,0.1];
let CLOUD = [0.3,0.3,1.0];
let SNOW = [1.0,0.8,0.4];
to
let naturalColour = [0,0,0,0];
let CLEAR = naturalColour;
let SHADOW = naturalColour;
let WATER = [0.1,0.1,0.7,1];
let CIRRUS = [0.8,0.1,0.1,1];
let CLOUD = [0.3,0.3,1.0,1];
let SNOW = [1.0,0.8,0.4,1];
Note that all other outputs need to be 4-channel ones as well.