Update README.md
Browse files
README.md
CHANGED
|
@@ -8,6 +8,13 @@ A collection of 38,176 emoji images from Facebook, Google, Apple, WhatsApp, Sams
|
|
| 8 |
* More generally: `String.fromCodePoint(...filename.split("_")[1].split("-").map(n => parseInt(n, 16)))`
|
| 9 |
* The tar files directly contain the image files (they're not inside a parent folder).
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
## Facebook examples:
|
| 12 |

|
| 13 |
|
|
|
|
| 8 |
* More generally: `String.fromCodePoint(...filename.split("_")[1].split("-").map(n => parseInt(n, 16)))`
|
| 9 |
* The tar files directly contain the image files (they're not inside a parent folder).
|
| 10 |
|
| 11 |
+
Here's some JavaScript code to convert the file name of an emoji image into the actual Unicode emoji character:
|
| 12 |
+
```js
|
| 13 |
+
let filename = ...;
|
| 14 |
+
let fixedFilename = filename.replace(/(no|light|medium|medium-light|medium-dark|dark)-skin-tone/, "").replace(/__/, "_").replace(/--/, "-");
|
| 15 |
+
let emoji = String.fromCodePoint(...fixedFilename.split("_")[1].split(".")[0].split("-").map(hex => parseInt(hex, 16)));
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
## Facebook examples:
|
| 19 |

|
| 20 |
|