Hello,
It has been quite a while that I used processing hence I have old habits that do not seems to work now.
Previoulsy I was used to « print » the content of the variables in the console at the bottom of the screen with the command print(barX);
Now it does not work as nothing apperas in the console.
Can you help me please?
Below is the code I am using.
"
- @name Hue
- @description Hue is the color reflected from or transmitted through an
- object and is typically referred to as the name of the color (red, blue,
- yellow, etc.) Move the cursor vertically over each bar to alter its hue.
*/
const barWidth = 20;
let lastBar = -1;
function setup() {
createCanvas(720, 400);
colorMode(HSB, height, height, height);
noStroke();
background(0);
}
function draw() {
let whichBar = mouseX / barWidth;
if (whichBar !== lastBar) {
let barX = whichBar * barWidth;
fill(mouseY, height, height);
rect(barX, 0, barWidth, height);
print(barX);
lastBar = whichBar;
}
}
"