xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
}
function draw() {
//background(0);
colorMode(HSB, 360, 100, 100);
//erster Wert: Farbe; zweiter Wert: Sättigung; dritter Wert: Helligkeit
//fill(100, 100, 100);
//Code damit der ganze Farbraum gleichmäßig auf der Bildschirmbreite verteilt wird
var col = map(mouseX, 0, width, 0, 360);
stroke(col, 100, 100);
//line(mouseX, 0, mouseX, height);
if (mouseIsPressed){
line(mouseX, 0, mouseX, height);
//Zeigt Farbdaten; dafür ist Background notwendig
//fill(0, 0, 100);
//text(mouseX, 20, 20);
//text(col, 20, 40);
translate(width/2, height/2);
rotate(radians(col) );
rectMode(CENTER);
noFill();
rect(0, 0, col, col);
}
}