createCanvas(windowWidth, windowHeight);
cyan = color(random(255),random(255),random(255))
magenta = color(random(255),random(255),random(255))
yellow = color(random(255),random(255),random(255))
black = color(random(255),random(255),random(255))
let cg = createGraphics(width, height)
for (let index = 0; index < 100; index++) {
let radius = random(70,100)
cg.fill(random(255),random(255),random(255))
cg.circle(random(width),random(height),radius)
let spotamp = random(20,40)
for (let Y = 50; Y < height-50; Y = Y + 20) {
for (let X = 50; X < width-50; X = X + 20) {
let thisRGB = cg.get(X, Y)
let thisCMYK = RGBtoCMYK(thisRGB[0], thisRGB[1], thisRGB[2])
let CMYKspotsize = CMYKtoSpotSize(...thisCMYK, spotamp)
circle(X, Y - diff, CMYKspotsize[3])
circle(X - diff, Y, CMYKspotsize[0])
circle(X, Y + diff, CMYKspotsize[1])
circle(X + diff, Y, CMYKspotsize[2])
describe("This art is made using p5js. The dots are displayed and colorful.")
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
function RGBtoCMYK(r, g, b) {
k = min(1 - r1, 1 - g1, 1 - b1)
c = (1 - r1 - k) / (1 - k);
m = (1 - g1 - k) / (1 - k);
y = (1 - b1 - k) / (1 - k);
function CMYKtoSpotSize(c, m, y, k,spotSize) {
let circleRad = spotSize;
cs = map(c, 0, 1, 0, circleRad);
ms = map(m, 0, 1, 0, circleRad);
ys = map(y, 0, 1, 0, circleRad);
ks = map(k, 0, 1, 0, circleRad);