thanks.
tried it in the first time with beginRecord() and the default renderer but that was not working ...
i know now why, the hsb export will just work if you set the colormode in that way:
pdf.colorMode(HSB, 360, 100, 100, 100);
for some reason pdf.colorMode(HSB) (without the explicit values) does not work like expected with beginRecord() ... but then again works correctly with beginRaw()? bug?
anyway now everything is working :)
benedikt
Code:
import processing.pdf.*;
PGraphicsPDF pdf;
boolean dosave=false;
void setup() {
size(800, 800);
colorMode(HSB, 360, 100, 100, 100);
noStroke();
}
void draw() {
if(dosave) {
pdf = (PGraphicsPDF) createGraphics(width, height, PDF, "hsb_test_"+frameCount+".pdf");
beginRecord(pdf);
// set default
pdf.colorMode(HSB, 360, 100, 100, 100);
pdf.strokeJoin(MITER);
pdf.strokeCap(SQUARE);
pdf.fill(0);
pdf.noStroke();
pdf.rect(0,0,width,height);
}
fill(120,100,100);
rect(0,0,width,height);
fill(240,100,100);
rect(width*0.33,0,width,height);
fill(360,100,100);
rect(width*0.33*2,0,width,height);
if(dosave) {
endRecord();
dosave=false;
}
}
void keyPressed() {
if (key == 's' || key == 'S') {
dosave=true;
saveFrame("hsb_test_"+frameCount+".png");
}
}