import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Clipboard;
colorMode(HSB, 360, 100, 100);
font = loadFont("CenturyGothic-32.vlw");
font2 = loadFont("ArialMT-32.vlw");
for (int i = 20; i < 380; i++) {
triangle(s1-7, 9, s1 + 7, 9, s1, 25);
if (s1b == true && s2b == false) s1 = mouseX;
if (s2b == false && mousePressed && mouseX > 20 && mouseY > 20 && mouseX < 380 && mouseY < 40) s1b = true;
for (int i = 21; i < 120; i++) {
for (int z = 61; z < 160; z++) {
color v = color(s1 - 21, i - 20, z-61);
if (ey > 110) stroke(0,0,0);
if (s2b == true && s1b == false) {
if (s1b == false && mousePressed && mouseX > 20 && mouseY > 60 && mouseX < 120 && mouseY < 160) s2b = true;
rect(0, 0, width - 1, height - 1);
if (mouseX > 400 && mouseY > 20 && mouseX < 440 && mouseY < 40) {
} else stroke(0, 100, 0);
colorMode(HSB, 360, 100, 100);
text("HSB (" + int(hue(c)) + ", " + int(saturation(c)) + ", " + int(brightness(c)) + ")", 253, 85);
colorMode(RGB, 255, 255, 255);
text("RGB (" + int(red(c)) + ", " + int(green(c)) + ", " + int(blue(c)) + ")", 253, 116);
text("HEX #" + hex(c, 6), 253, 145);
colorMode(HSB, 360, 100, 100);
if (c1 == false && mouseX > 253 && mouseY > 70 && mouseX < 253 + textWidth("HSB (" + int(hue(c)) + ", " + int(saturation(c)) + ", " + int(brightness(c)) + ")") && mouseY < 85) {
rect(mouseX + 10,mouseY + 13,63,13);
text("Click to copy!",mouseX + 13,mouseY + 23);
rect(mouseX + 10,mouseY + 13,39,13);
text("Copied!",mouseX + 13,mouseY + 23);
if (mouseX < 253 || mouseY < 70 || mouseX > 253 + textWidth("HSB (" + int(hue(c)) + ", " + int(saturation(c)) + ", " + int(brightness(c)) + ")") || mouseY > 85) c1 = false;
if (c2 == false && mouseX > 253 && mouseY > 100 && mouseX < 253 + textWidth("RGB (" + int(red(c)) + ", " + int(green(c)) + ", " + int(blue(c)) + ")") && mouseY < 115) {
rect(mouseX + 10,mouseY + 13,63,13);
text("Click to copy!",mouseX + 13,mouseY + 23);
rect(mouseX + 10,mouseY + 13,39,13);
text("Copied!",mouseX + 13,mouseY + 23);
if (mouseX < 253 || mouseY < 100 || mouseX > 253 + textWidth("RGB (" + int(red(c)) + ", " + int(green(c)) + ", " + int(blue(c)) + ")") || mouseY > 115) c2 = false;
if (c3 == false && mouseX > 253 && mouseY > 130 && mouseX < 253 + textWidth("HEX #" + hex(c, 6)) && mouseY < 145) {
rect(mouseX + 10,mouseY + 13,63,13);
text("Click to copy!",mouseX + 13,mouseY + 23);
rect(mouseX + 10,mouseY + 13,39,13);
text("Copied!",mouseX + 13,mouseY + 23);
if (mouseX < 253 || mouseY < 130 || mouseX > 253 + textWidth("HEX #" + hex(c, 6)) || mouseY > 145) c3 = false;
if (mouseX > 253 && mouseY > 70 && mouseX < 253 + textWidth("HSB (" + int(hue(c)) + ", " + int(saturation(c)) + ", " + int(brightness(c)) + ")") && mouseY < 85) {
StringSelection selection = new StringSelection(int(hue(c)) + ", " + int(saturation(c)) + ", " + int(brightness(c)));
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(selection, selection);
println(int(hue(c)) + ", " + int(saturation(c)) + ", " + int(brightness(c)));
colorMode(RGB, 255, 255, 255);
if (mouseX > 253 && mouseY > 100 && mouseX < 253 + textWidth("RGB (" + int(red(c)) + ", " + int(green(c)) + ", " + int(blue(c)) + ")") && mouseY < 115) {
StringSelection selection = new StringSelection(int(red(c)) + ", " + int(green(c)) + ", " + int(blue(c)));
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(selection, selection);
println(int(red(c)) + ", " + int(green(c)) + ", " + int(blue(c)));
if (mouseX > 253 && mouseY > 130 && mouseX < 253 + textWidth("HEX #" + hex(c, 6)) && mouseY < 145) {
StringSelection selection = new StringSelection("#" + hex(c, 6));
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(selection, selection);
println("#" + hex(c, 6));
colorMode(HSB, 360, 100, 100);