Skip to content

Commit

Permalink
docs: 📝 update readme with the new api
Browse files Browse the repository at this point in the history
  • Loading branch information
michyaraque committed Jan 2, 2023
1 parent fe2e2d9 commit 3c0edbc
Showing 1 changed file with 12 additions and 26 deletions.
38 changes: 12 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,26 @@ yarn add emoji-toolbox
```
Once you have it installed, you can use it in your code like this:

#### ES6
```js
const Emoji = require('emoji-toolbox');

const emojiSoftColor = new Emoji("").emojiData;
```

#### Typescript
```typescript
import Emoji from 'emoji-toolbox';
#### API

const emoji = new Emoji("🧽");

const emojiObject = emoji.emojiData; // All emoji data

const emojiName = emoji.name();
const emojiUnicode = emoji.unicode();
```js
import emoji from 'emoji-toolbox';

// Normal color (The base)
const colorHexN = emoji.normalColor().hexadecimal;
const colorRGBN = emoji.normalColor().rgb;
emoji.identifier(""); // Returns the identifier of the emoji: white_check_mark
emoji.humanName(""); // Returns the identifier in human readable: White Check Mark
emoji.unicode(""); // Unicode value: U+2705
emoji.normalColor("", "rgb"); // Defaults return RGB value by default
emoji.softColor("", "hex"); // Hexadecimal explit
emoji.darkenColor("", "both"); // object of rgb and hex values

// The most darken color with -40% of brightness and saturation
const colorHexS = emoji.softColor().hexadecimal;
const colorRGBS = emoji.softColor().rgb;
emoji.hasEmoji("Detect if this phrase contains a emoji 🧰"); // True
emoji.demojify("Remove emoji from phrase 🗯️"); // Remove emoji from phrase

// The most darken color with +40% of brightness and saturation
const colorHexD = emoji.darkenColor().hexadecimal;
const colorRGBD = emoji.darkenColor().rgb;
```

This code creates a new instance of the Emoji class with the "🧽" emoji as an argument. You can then access the various properties and methods of this instance to get different pieces of data about the emoji.

For example, the emojiData property contains all the data for the emoji, including its name, Unicode, and various color styles. The name() and unicode() methods return the name and Unicode of the emoji, respectively. The normalColor() method returns the base color style of the emoji, and its hexadecimal and rgb properties contain the color in hexadecimal and RGB formats, respectively.

## License
Emoji Toolbox is available under the Apache-2.0 License.
Emoji Toolbox is available under the Apache-2.0 License.

0 comments on commit 3c0edbc

Please sign in to comment.