Skip to content
This repository was archived by the owner on Feb 28, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
117 changes: 65 additions & 52 deletions dist/p5.accessibility.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/Example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function draw() {
ellipse(20,20,20,20);
fill(32,255,65);
ellipse(50,x,10,10);
fill("#00ffb2");
fill(`#00ffb2`);
ellipse(150,200-x,10,10);
fill(150);
rect(170,170,25,25);
Expand Down
9 changes: 5 additions & 4 deletions src/baseInterceptor.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const MAX_OBJECTS = 20;
function baseInterceptor() {
this.prevTotalCount = 0,
this.totalCount = 0,
Expand Down Expand Up @@ -186,7 +187,7 @@ function RGBAString(arguments) {
return (getRGBAname(values));
} else if (((arguments[0].match(/%/g)).length) === 3) {
// when arguments[0] is 'rgba(10%,100%,30%,0.5)'
// This line creates an array with the values in order the following order ["R","G","B","A"]. The RegEx looks for three values with percentages and one value without percentage.
// This line creates an array with the values in order the following order ["R","G","B","A"]. The RegEx looks for three values with percentages and one value without percentage.
const values = (((arguments[0].match(/(\(\s*?((000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|(000(?:\.+\d*)|0?\d{1,2}(?:\.+\d*)|1\d\d(?:\.+\d*)|2[0-4]\d(?:\.+\d*)|25[0-5](?:\.+\d*)))\s*?%,\s*?((000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|(000(?:\.+\d*)|0?\d{1,2}(?:\.+\d*)|1\d\d(?:\.+\d*)|2[0-4]\d(?:\.+\d*)|25[0-5](?:\.+\d*)))\s*?%,\s*?((000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|(000(?:\.+\d*)|0?\d{1,2}(?:\.+\d*)|1\d\d(?:\.+\d*)|2[0-4]\d(?:\.+\d*)|25[0-5](?:\.+\d*)))\s*?%,\s*?((000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|(000(?:\.+\d*)|0?\d{1,2}(?:\.+\d*)|1\d\d(?:\.+\d*)|2[0-4]\d(?:\.+\d*)|25[0-5](?:\.+\d*)))\s*?\))/g))[0]).replace(/%|\(|\)/g, ``)).split(`,`);
for (let i = values.length - 2; i >= 0; i--) {
if (parseInt(values[i]) < 100) {
Expand Down Expand Up @@ -229,7 +230,7 @@ function RGBString(arguments) {
if (arguments[0].match(/%/)) {
if (((arguments[0].match(/%/g)).length) === 3) {
// when arguments[0] is 'rgb(10%,100%,30%)'
// This line creates an array with the values in order the following order ["R","G","B"]. The RegEx looks for three values with percentages.
// This line creates an array with the values in order the following order ["R","G","B"]. The RegEx looks for three values with percentages.
const values = (((arguments[0].match(/(\(\s*?((000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|(000(?:\.+\d*)|0?\d{1,2}(?:\.+\d*)|1\d\d(?:\.+\d*)|2[0-4]\d(?:\.+\d*)|25[0-5](?:\.+\d*)))\s*?%,\s*?((000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|(000(?:\.+\d*)|0?\d{1,2}(?:\.+\d*)|1\d\d(?:\.+\d*)|2[0-4]\d(?:\.+\d*)|25[0-5](?:\.+\d*)))\s*?%,\s*?((000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|(000(?:\.+\d*)|0?\d{1,2}(?:\.+\d*)|1\d\d(?:\.+\d*)|2[0-4]\d(?:\.+\d*)|25[0-5](?:\.+\d*)))\s*?%\s*?\))/g))[0]).replace(/%|\(|\)/g, ``)).split(`,`);
for (let i = values.length - 1; i >= 0; i--) {
if (parseInt(values[i]) < 100) {
Expand All @@ -245,9 +246,9 @@ function RGBString(arguments) {
}
} else {
// when arguments[0] is 'rgb(10,100,30)'
// This line creates an array with the values in order the following order ["R","G","B"]. Values must be less than 255.
// This line creates an array with the values in order the following order ["R","G","B"]. Values must be less than 255.
let values = (((arguments[0].match(/(\(\s*?((000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|(000(?:\.+\d*)|0?\d{1,2}(?:\.+\d*)|1\d\d(?:\.+\d*)|2[0-4]\d(?:\.+\d*)|25[0-5](?:\.+\d*)))\s*?,\s*?((000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|(000(?:\.+\d*)|0?\d{1,2}(?:\.+\d*)|1\d\d(?:\.+\d*)|2[0-4]\d(?:\.+\d*)|25[0-5](?:\.+\d*)))\s*?,\s*?((000|0?\d{1,2}|1\d\d|2[0-4]\d|25[0-5])|(000(?:\.+\d*)|0?\d{1,2}(?:\.+\d*)|1\d\d(?:\.+\d*)|2[0-4]\d(?:\.+\d*)|25[0-5](?:\.+\d*)))\s*?\))/g))[0]).replace(/(\(|\))/g, ``)).split(`,`);
values = [parseInt(values[0]), parseInt(values[1]), parseInt(values[2])];
return (getRGBname(values));
}
}
}
Loading