Change emoji skin tones effortlessly. π§π§π»π§πΌπ§π½π§πΎπ§πΏ
- Example of using the library: Random Emoji Generator
- Pen: Codepen
npm i @qit.tools/skin-tone
bun add @qit.tools/skin-tone
pnpm add @qit.tools/skin-tone
yarn add @qit.tools/skin-tone
// Import by default
import skinTone from "@qit.tools/skin-tone";
console.log(skinTone("π§", "dark")); // π§
console.log(skinTone("π§πΏβπ€βπ§πΏ", "light")); // π§π»βπ€βπ§π»
// https://unpkg.com/@qit.tools/skin-tone@0.6.2/dist/browser/latest.min.js
document.addEventListener("DOMContentLoaded", () => {
console.log(skinTone("π§π»βπ€βπ§π»", "dark"));
});
skinTone(emoji, tone)
Type: string
type SkinTone = '' | 'none' | 'light' | 'mediumLight' | 'medium' | 'mediumDark' | 'dark'
Type: SkinTone | undefined
none
None skin tonelight
light skin tone, fitzpatrick type-1β2mediumLight
medium-light skin tone, fitzpatrick type-3medium
medium skin tone, fitzpatrick type-4mediumDark
medium-dark skin tone, fitzpatrick type-5dark
dark skin tone, fitzpatrick type-6
MIT