Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini committed Aug 8, 2023
1 parent 06185d5 commit bac20d0
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ Rendering app into DOM and animate it.

Controlling the aesthetic appearance of the shapes.

- [app.**scene**](#app-scene)
- [app.**background**](#app-background)
- [app.**stroke**](#app-stroke)
- [app.**noStroke**](#app-nostroke) - Disables drawing the stroke of shapes.
- [app.**fill**](#app-fill)
- [app.**noFill**](#app-nofill) - Disables drawing the fill of shapes.
- [cm.**wide**](#cm-wide)
- [app.**scene**](#app-scene) - Sets the specified css _color_ used for the background of the rendering context of the app and returns this app.
- [app.**background**](#app-background) - Sets the specified color (_ch_, _fg_, _bg_) used for the background of the app in cells and returns this app.
- [app.**stroke**](#app-stroke) - Sets the specified color (_ch_, _fg_, _bg_) for drawing the stroke of shapes and returns this app.
- [app.**noStroke**](#app-nostroke) - Disables drawing the stroke of shapes and returns this app.
- [app.**fill**](#app-fill) - Sets the specified color (_ch_, _fg_, _bg_) for drawing the fill of shapes and returns this app.
- [app.**noFill**](#app-nofill) - Disables drawing the fill of shapes and returns this app.
- [cm.**wide**](#cm-wide) - Marks the _ch_ as a wide character and returns the marked code point of it.

### [Drawing Shapes](#drawing-shapes-1)

Expand Down Expand Up @@ -198,21 +198,23 @@ app.stop();

<a name="app-scene" href="#app-scene">#</a> app.**scene**(_color_)

Sets the specified css _color_ used for the background of the rendering context of the app and returns this app. For example, to render a light theme app:

```js
app.scene("#000000");
app.scene("#aaaaaa");
```

<a name="app-background" href="#app-background">#</a> app.**background**(_ch[, fg[, bg]]_)

Sets the specified color used for the background of the app.
Sets the specified color (_ch_, _fg_, _bg_) used for the background of the app in cells and returns this app. For example, to color every cells with `("·", "steelblue", "orange")`:

```js
app.background("·", "steelblue", "orange");
```

<a name="app-stroke" href="#app-stroke">#</a> app.**stroke**(_ch[, fg[, bg]]_)

Sets the specified color (_ch_, _fg_, _bg_) for drawing the stroke of shapes. Calling _app_.stroke means all the shapes drawn after that will be stroked with the specified color. For example, to draw a [point](#app-point) and a [line](#app-line) with the same stroke:
Sets the specified color (_ch_, _fg_, _bg_) for drawing the stroke of shapes and returns this app. Calling _app_.stroke means all the shapes drawn after that will be stroked with the specified color. For example, to draw a [point](#app-point) and a [line](#app-line) with the same stroke:

```js
app.stroke("@", "steelblue", "orange");
Expand All @@ -222,7 +224,7 @@ app.line(0, 0, 10, 10);

<a name="app-nostroke" href="#app-nostroke">#</a> app.**noStroke**()

Disables drawing the stroke of shapes. For example, to draw a only filled [rectangle](#app-rect):
Disables drawing the stroke of shapes and returns this app. For example, to draw a only filled [rectangle](#app-rect):

```js
app.noStroke();
Expand All @@ -232,7 +234,7 @@ app.rect(0, 0, 5, 5);

<a name="app-fill" href="#app-fill">#</a> app.**fill**(_ch[, fg[, bg]]_)

Sets the specified color (_ch_, _fg_, _bg_) for drawing the fill of shapes. Calling _app_.fill means all the shapes drawn after that will be filled with the specified color. For example, to draw two filled [rectangles](#app-rect) with the same fill:
Sets the specified color (_ch_, _fg_, _bg_) for drawing the fill of shapes and returns this app. Calling _app_.fill means all the shapes drawn after that will be filled with the specified color. For example, to draw two filled [rectangles](#app-rect) with the same fill:

```js
app.fill("@", "steelblue", "orange");
Expand All @@ -242,7 +244,7 @@ app.rect(6, 6, 3, 3);

<a name="app-nofill" href="#app-nofill">#</a> app.**noFill**()

Disables drawing the fill of shapes. For example, to draw only stroked [rectangle](#app-rect):
Disables drawing the fill of shapes and returns this app. For example, to draw only stroked [rectangle](#app-rect):

```js
app.noFill();
Expand All @@ -252,8 +254,16 @@ app.rect(0, 0, 5, 5);

<a name="cm-wide" href="#cm-wide">#</a> cm.**wide**(_ch_)

Marks the _ch_ as a wide character and returns the marked code point of it. In double mode, a wide character draws once to fill a cell, and a normal character draws twice to fill a cell. For example, to draw two [lines](#app-line) stroked with different characters but with equal length:

```js
cm.wide("🚀");
const app = await cm.app({ mode: "double" });

app.stroke(cm.wide("🚀"));
app.line(0, 0, 10, 0);

app.stoke("@");
app.line(0, 2, 10, 2);
```

## Drawing Shapes
Expand Down

0 comments on commit bac20d0

Please sign in to comment.