Skip to content

Commit

Permalink
smurf + palette
Browse files Browse the repository at this point in the history
  • Loading branch information
v3ga committed Jan 2, 2023
1 parent c34032f commit d14d6fd
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
Binary file added img/DESSIN_GEOMETRIQUE_46.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/DESSIN_GEOMETRIQUE_47.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/DESSIN_GEOMETRIQUE_48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/DESSIN_GEOMETRIQUE_49.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 32 additions & 3 deletions init_trace.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
// ----------------------------------------------------
var OUTPUT = "";
var DG_GREY = 245;
var PALETTES = {
"RED" : ["#E4BAA8","#8F080E"], // background, stroke
"GREEN" : ["#99C7BB","#005B51"],
"YELLOW" : ["#E6DB76","#040A53"]
};

var BG_COLOR=DG_GREY,STROKE_COLOR=0;
var PALETTE_SELECT;

// ----------------------------------------------------
function SGN(X)
Expand All @@ -14,27 +22,47 @@ function LPRINT(s)
OUTPUT+=s;
}

// ----------------------------------------------------
function PALETTE(which)
{
let p = PALETTES[which];
if (p)
{
BG_COLOR=p[0];
STROKE_COLOR=p[1];
PALETTE_SELECTED=which;
}
else
{
BG_COLOR=DG_GREY;
STROKE_COLOR=0;
}
}

// ----------------------------------------------------
function INIT()
{
createCanvas(NP,NP);
background(DG_GREY);
background(BG_COLOR);
stroke(STROKE_COLOR);
noFill();
}

// ----------------------------------------------------
function INIT2(H)
{
createCanvas(NP,H);
background(DG_GREY);
background(BG_COLOR);
stroke(STROKE_COLOR);
noFill();
}

// ----------------------------------------------------
function INIT_WH(W,H)
{
createCanvas(W,H);
background(DG_GREY);
background(BG_COLOR);
stroke(STROKE_COLOR);
noFill();
}

Expand Down Expand Up @@ -161,6 +189,7 @@ function keyPressed()
{
let filename = "DESSIN_GEOMETRIQUE"
if (DESSIN) filename += `_${DESSIN}`;
if (PALETTE_SELECT) filename += `_${PALETTE_SELECT}`;
filename+=".png";
save(filename);
}
Expand Down

0 comments on commit d14d6fd

Please sign in to comment.