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/[email protected]/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