Here’s where I am at:
I discovered the “else if” statement, now I’m able to divide in as many segments as I want, and have gui access to them individually. It’s not a pretty way, as the hue pickers will be in the gui regardless of the segments I want active(I wonder, is it possible to use “if” statements to have the pickers appear depending on active segments?). I applied this method at zranger1’s Oasis pattern, and I’m able to divide it in 2 segments with different colours each, nice:)
The math is still wrong, I could use some help with that, please have a look at the code:
// Colour Picker 1
export function hsvPickerHue1(h, s, v) {
hue1 = h
saturation1 = s
value1 = v
}
//Colour Picker 2
export function hsvPickerHue2(h, s, v) {
hue2 = h
saturation2 = s
value2 = v
}
//Colour Picker 3
export function hsvPickerHue3(h, s, v) {
hue3 = h
saturation3 = s
value3 = v
}
export var depth1
export function sliderDepth1(v) {
depth1 = floor(v * 100 );
}
export var depth2
export function sliderDepth2(v) {
depth2 = floor(v * 100 );
}
export function render(index) {
if (index < depth1 % pixelCount) {
hue = hue1
saturation = saturation1
value = value1
hsv(hue1, saturation1, value1)
}
else if (index < (depth1 % pixelCount) + depth2) {
hue = hue2
saturation = saturation2
value = value2
hsv(hue2, saturation2, value2)
} else {
hue = hue3
saturation = saturation3
value = value3
hsv(hue3, saturation3, value3)
}
}
I still don’t get how to properly paste code in here, sorry:)