Skip to content

Commit

Permalink
Fixes #19 Initial color picker for foreground not matching actual color.
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyegan committed Jul 26, 2014
1 parent 4df9e25 commit 61fa538
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions sketch3d.pde
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,6 @@ void setup() {

//smooth();

//GUI
cp5 = new ControlP5(this);
createControllers( cp5 );
cp5.setAutoDraw(false);
cp5.getPointer().enable();

uiFont = createFont("Helvetica", 20);
textFont(uiFont, 20);

displayOrigin = true;
displaySkeleton = true;

menuState = MENUS_OFF;

drawingNow = false;
Expand Down Expand Up @@ -144,6 +132,18 @@ void setup() {
bgColorHSB = new PVector( 0.0, 0.0, 0.2 );
oldBgColorHSB = new PVector();
bgColor = Color.HSBtoRGB( bgColorHSB.x, bgColorHSB.y, bgColorHSB.z);

//GUI
cp5 = new ControlP5(this);
createControllers( cp5 );
cp5.setAutoDraw(false);
cp5.getPointer().enable();

uiFont = createFont("Helvetica", 20);
textFont(uiFont, 20);

displayOrigin = true;
displaySkeleton = true;

bgImage = loadImage("data/testBackground.jpg");
displayBackgroundImage = false;
Expand Down Expand Up @@ -290,8 +290,7 @@ void draw() {
if ( currentColor == FOREGROUND ) {
brushColor = colorChooser.getColorValue();
fgbgToggle.setColorForeground(brushColor);
}
else {
} else {
bgColor = colorChooser.getColorValue();
shader.set("fogColor", red(bgColor) / 255.0, green(bgColor) / 255.0, blue(bgColor) / 255.0, 1.0 );
fgbgToggle.setColorBackground(bgColor);
Expand Down Expand Up @@ -659,8 +658,8 @@ void updateDrawingHand() {
void createControllers(ControlP5 cp5) {

currentColor = FOREGROUND;
brushColor = color(0);
bgColor = color(255);
//brushColor = color(0);
//bgColor = color(255);

int fontSize = 18;
PFont pfont = createFont("Arial", fontSize, true); // use true/false for smooth/no-smooth
Expand Down

0 comments on commit 61fa538

Please sign in to comment.