Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1be7b20
implemented first 10 getters
dhowe Dec 8, 2025
ae9af30
more getters
dhowe Dec 9, 2025
8f7a431
complete first set of getters
dhowe Dec 10, 2025
039ef43
update parameter json, add tests for getters
dhowe Dec 10, 2025
ece3986
add bezierOrder and splineProperties to tests
dhowe Dec 10, 2025
8d43489
Merge branch 'dev-2.0' into ticket8278
dhowe Feb 1, 2026
255af5a
remove getters for matrix transforms: shear, rotate, translate, scale
dhowe Feb 1, 2026
f26eff6
remove translate, rotate, scale from getter tests
dhowe Feb 1, 2026
be4de98
re-implemented tint, plus textureWrap and textureMode
dhowe Feb 1, 2026
f87df11
update fes data
dhowe Feb 1, 2026
6d2734c
Merge branch 'dev-2.0' into ticket8278
dhowe Feb 2, 2026
67bd05b
fix to #8469 in dev-2.0
dhowe Feb 16, 2026
0f82b9b
Revert "fix to #8469 in dev-2.0"
dhowe Feb 16, 2026
0f67aa4
Merge branch 'processing:dev-2.0' into dev-2.0
dhowe Mar 22, 2026
af7b67a
Merge branch 'dev-2.0' into ticket8278
dhowe Mar 23, 2026
3559fad
fix to bug with color in tint
dhowe Mar 23, 2026
4c51317
merge from dev2.0
dhowe Mar 23, 2026
d22cd36
using 255 range for tint in shaders
dhowe Mar 23, 2026
f9460f4
fix tint-related gl tests
dhowe Mar 23, 2026
2b30d89
Merge branch 'dev-2.0' into ticket8278
dhowe Mar 23, 2026
19c6851
first pass at updating jsdocs for setters
dhowe Mar 24, 2026
85d6ccc
updated inline jsdocs for all setters that have them
dhowe Mar 24, 2026
1a408af
remove no-longer used decomposeMatrix function
dhowe Mar 24, 2026
acc319a
fixes from reviewer
dhowe Mar 25, 2026
3d4d45e
fix to tint argument handling
dhowe Mar 25, 2026
227c6a3
Merge branch 'dev-2.0' into ticket8278
dhowe Mar 25, 2026
0bf343a
fix to tint in Renderer3D
dhowe Mar 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions docs/parameterData.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@
},
"ellipseMode": {
"overloads": [
[],
[
"CENTER|RADIUS|CORNER|CORNERS"
]
Expand Down Expand Up @@ -808,6 +809,7 @@
},
"rectMode": {
"overloads": [
[],
[
"CENTER|RADIUS|CORNER|CORNERS"
]
Expand Down Expand Up @@ -878,7 +880,8 @@
"ARROW|CROSS|HAND|MOVE|TEXT|WAIT|String",
"Number?",
"Number?"
]
],
[]
]
},
"createElement": {
Expand Down Expand Up @@ -1086,7 +1089,8 @@
"overloads": [
[
"ROUND|SQUARE|PROJECT"
]
],
[]
]
},
"lerp": {
Expand Down Expand Up @@ -1292,7 +1296,8 @@
"overloads": [
[
"MITER|BEVEL|ROUND"
]
],
[]
]
},
"noCursor": {
Expand Down Expand Up @@ -1391,7 +1396,8 @@
"overloads": [
[
"Number"
]
],
[]
]
},
"degrees": {
Expand Down Expand Up @@ -2268,6 +2274,7 @@
},
"colorMode": {
"overloads": [
[],
[
"RGB|HSB|HSL|RGBHDR|HWB|LAB|LCH|OKLAB|OKLCH",
"Number?"
Expand Down Expand Up @@ -2492,6 +2499,7 @@
},
"tint": {
"overloads": [
[],
[
"Number",
"Number",
Expand Down Expand Up @@ -2631,6 +2639,7 @@
},
"fill": {
"overloads": [
[],
[
"Number",
"Number",
Expand Down Expand Up @@ -2680,7 +2689,8 @@
[
"LEFT|CENTER|RIGHT?",
"TOP|BOTTOM|CENTER|BASELINE?"
]
],
[]
]
},
"textAscent": {
Expand All @@ -2701,15 +2711,17 @@
"overloads": [
[
"Number?"
]
],
[]
]
},
"textFont": {
"overloads": [
[
"p5.Font|String|Object?",
"Number?"
]
],
[]
]
},
"textSize": {
Expand Down Expand Up @@ -2854,6 +2866,7 @@
},
"imageMode": {
"overloads": [
[],
[
"CORNER|CORNERS|CENTER"
]
Expand Down Expand Up @@ -2983,6 +2996,7 @@
},
"stroke": {
"overloads": [
[],
[
"Number",
"Number",
Expand Down Expand Up @@ -3227,6 +3241,7 @@
},
"blendMode": {
"overloads": [
[],
[
"BLEND|DARKEST|LIGHTEST|DIFFERENCE|MULTIPLY|EXCLUSION|SCREEN|REPLACE|OVERLAY|HARD_LIGHT|SOFT_LIGHT|DODGE|BURN|ADD|REMOVE|SUBTRACT"
]
Expand Down Expand Up @@ -3298,7 +3313,8 @@
"overloads": [
[
"Object"
]
],
[]
]
},
"linePerspective": {
Expand Down Expand Up @@ -3387,7 +3403,8 @@
"overloads": [
[
"IMAGE|NORMAL"
]
],
[]
]
},
"setCamera": {
Expand All @@ -3409,7 +3426,8 @@
[
"CLAMP|REPEAT|MIRROR",
"CLAMP|REPEAT|MIRROR?"
]
],
[]
]
},
"normalMaterial": {
Expand Down
2 changes: 1 addition & 1 deletion src/color/p5.Color.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ class Color {
if(!Array.isArray(v)){
return [0, v];
}else{
return v
return v;
}
});

Expand Down
29 changes: 22 additions & 7 deletions src/color/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,7 @@ function setting(p5, fn){
* @chainable
*/
fn.background = function(...args) {
this._renderer.background(...args);
return this;
return this._renderer.background(...args);
};

/**
Expand Down Expand Up @@ -1096,6 +1095,8 @@ function setting(p5, fn){
* or `HSLA` colors, depending on the current <a href="#/p5/colorMode">colorMode()</a>. The last parameter
* sets the alpha (transparency) value.
*
* Calling `fill()` without an argument returns the current fill as a <a href="#/p5.Color">p5.Color</a> object.
*
* @method fill
* @param {Number} v1 red value if color mode is RGB or hue value if color mode is HSB.
* @param {Number} v2 green value if color mode is RGB or saturation value if color mode is HSB.
Expand Down Expand Up @@ -1284,9 +1285,12 @@ function setting(p5, fn){
* @param {p5.Color} color the fill color.
* @chainable
*/
/**
* @method fill
* @return {p5.Color} the current fill color.
*/
fn.fill = function(...args) {
this._renderer.fill(...args);
return this;
return this._renderer.fill(...args);
};

/**
Expand Down Expand Up @@ -1415,6 +1419,8 @@ function setting(p5, fn){
* or HSLA colors, depending on the current `colorMode()`. The last parameter
* sets the alpha (transparency) value.
*
* Calling `stroke()` without an argument returns the current stroke as a <a href="#/p5.Color">p5.Color</a> object.
*
* @method stroke
* @param {Number} v1 red value if color mode is RGB or hue value if color mode is HSB.
* @param {Number} v2 green value if color mode is RGB or saturation value if color mode is HSB.
Expand Down Expand Up @@ -1601,9 +1607,12 @@ function setting(p5, fn){
* @param {p5.Color} color the stroke color.
* @chainable
*/
/**
* @method stroke
* @return {p5.Color} the current stroke color.
*/
fn.stroke = function(...args) {
this._renderer.stroke(...args);
return this;
return this._renderer.stroke(...args);
};

/**
Expand Down Expand Up @@ -1768,6 +1777,8 @@ function setting(p5, fn){
* EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT,
* SOFT_LIGHT, DODGE, BURN, ADD, REMOVE or SUBTRACT
*
* Calling `blendMode()` without an argument returns the current blendMode.
*
* @example
* function setup() {
* createCanvas(100, 100);
Expand Down Expand Up @@ -2136,6 +2147,10 @@ function setting(p5, fn){
* describe('A yellow line and a turquoise line form an X on a gray background. The area where they overlap is green.');
* }
*/
/**
* @method blendMode
* @return {(BLEND|DARKEST|LIGHTEST|DIFFERENCE|MULTIPLY|EXCLUSION|SCREEN|REPLACE|OVERLAY|HARD_LIGHT|SOFT_LIGHT|DODGE|BURN|ADD|REMOVE|SUBTRACT)} the current blend mode.
*/
fn.blendMode = function (mode) {
// p5._validateParameters('blendMode', arguments);
if (mode === constants.NORMAL) {
Expand All @@ -2145,7 +2160,7 @@ function setting(p5, fn){
);
mode = constants.BLEND;
}
this._renderer.blendMode(mode);
return this._renderer.blendMode(mode);
};
}

Expand Down
10 changes: 10 additions & 0 deletions src/core/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ function environment(p5, fn, lifecycles){
* cursor, `x` and `y` set the location pointed to within the image. They are
* both 0 by default, so the cursor points to the image's top-left corner. `x`
* and `y` must be less than the image's width and height, respectively.
*
* Calling `cursor()` without an argument returns the current cursor type as a string.
*
* @method cursor
* @param {(ARROW|CROSS|HAND|MOVE|TEXT|WAIT|String)} type Built-in: either ARROW, CROSS, HAND, MOVE, TEXT, or WAIT.
Expand Down Expand Up @@ -281,9 +283,17 @@ function environment(p5, fn, lifecycles){
* }
* }
*/
/**
* @method cursor
* @return {(ARROW|CROSS|HAND|MOVE|TEXT|WAIT|String)} the current cursor type
*/
fn.cursor = function(type, x, y) {
let cursor = 'auto';
const canvas = this._curElement.elt;
if (typeof type === 'undefined') {
let curstr = canvas.style.cursor;
return curstr.length ? curstr : 'default';
}
if (standardCursors.includes(type)) {
// Standard css cursor
cursor = type;
Expand Down
31 changes: 17 additions & 14 deletions src/core/p5.Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,20 @@ class Renderer {
rectMode: constants.CORNER,
ellipseMode: constants.CENTER,
strokeWeight: 1,
bezierOrder: 3,
splineProperties: new ClonableObject({
ends: constants.INCLUDE,
tightness: 0
}),

textFont: { family: 'sans-serif' },
textLeading: 15,
leadingSet: false,
textSize: 12,
textAlign: constants.LEFT,
textBaseline: constants.BASELINE,
bezierOrder: 3,
splineProperties: new ClonableObject({
ends: constants.INCLUDE,
tightness: 0
}),
textWrap: constants.WORD,

// added v2.0
fontStyle: constants.NORMAL, // v1: textStyle
fontStyle: constants.NORMAL, // v1: was textStyle
fontStretch: constants.NORMAL,
fontWeight: constants.NORMAL,
lineHeight: constants.NORMAL,
Expand Down Expand Up @@ -330,24 +328,29 @@ class Renderer {
}

fill(...args) {
this.states.setValue('fillSet', true);
this.states.setValue('fillColor', this._pInst.color(...args));
this.updateShapeVertexProperties();
if (args.length > 0) {
this.states.setValue('fillSet', true);
this.states.setValue('fillColor', this._pInst.color(...args));
this.updateShapeVertexProperties();
}
return this.states.fillColor;
}

noFill() {
this.states.setValue('fillColor', null);
}

strokeWeight(w) {
if (w === undefined) {
if (typeof w === 'undefined') {
return this.states.strokeWeight;
} else {
this.states.setValue('strokeWeight', w);
}
this.states.setValue('strokeWeight', w);
}

stroke(...args) {
if (args.length === 0) {
return this.states.strokeColor;
}
this.states.setValue('strokeSet', true);
this.states.setValue('strokeColor', this._pInst.color(...args));
this.updateShapeVertexProperties();
Expand Down
Loading
Loading