Skip to content

Commit b2c3b2d

Browse files
committed
Add generateRelative to README
1 parent cd5a6df commit b2c3b2d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ Or both together:
8181
const face = generate(undefined, { gender: "female", race: "asian" });
8282
```
8383

84+
### Relatives
85+
86+
There is a separate `generateRelative` function to make a relative of an existing face object. Call it like:
87+
88+
```javascript
89+
const { generate, generateRelative } = require("facesjs");
90+
const face1 = generate();
91+
const face2 = generateRelative({ gender: "male", relative: face1 });
92+
```
93+
94+
This works by randomizing only some features of the existing face, so the new face is fairly similar to the existing one, like an immediate family member.
95+
8496
### React integration
8597

8698
You can use the `display` function within any frontend JS framework, but for ease of use with the most popular one, this package includes a `Face` component for React.

0 commit comments

Comments
 (0)