@jamesrock/rockjs 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +19 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -288,8 +288,8 @@ export class BrickMaker extends DisplayObject {
288
288
 
289
289
  const node = this.node = createNode('div', 'brick-maker');
290
290
  const bits = this.bits = [];
291
-
292
- node.style.setProperty('--color', this.color);
291
+
292
+ this.setColor(color);
293
293
  node.style.width = node.style.height = `${scale*size + (gap*(size-1))}px`;
294
294
  node.style.gap = `${gap}px`;
295
295
 
@@ -363,6 +363,23 @@ export class BrickMaker extends DisplayObject {
363
363
 
364
364
  return this;
365
365
 
366
+ };
367
+ clear() {
368
+
369
+ this.bits.forEach((bit) => {
370
+ bit.dataset.active = 'N';
371
+ });
372
+ this.calculate();
373
+
374
+ return this;
375
+
376
+ };
377
+ setColor(color) {
378
+
379
+ this.color = color;
380
+ this.node.style.setProperty('--color', this.color);
381
+ return this;
382
+
366
383
  };
367
384
  value = null;
368
385
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamesrock/rockjs",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "utility bliss",
5
5
  "license": "ISC",
6
6
  "author": "James Rock",