Skip to content

Latest commit

 

History

History
93 lines (58 loc) · 1.83 KB

README.md

File metadata and controls

93 lines (58 loc) · 1.83 KB

Skin Tone

Test status

Change emoji skin tones effortlessly. 🧛🧛🏻🧛🏼🧛🏽🧛🏾🧛🏿

👀 DEMO

CDN

🏗️ Install

🎉 NPM

npm i @qit.tools/skin-tone

🧁 Bun

bun add @qit.tools/skin-tone

🌟 PNPM

pnpm add @qit.tools/skin-tone

🧶 Yarn

yarn add @qit.tools/skin-tone

🎓 How to use

NodeJS

// Import by default
import skinTone from "@qit.tools/skin-tone";

console.log(skinTone("🧁", "dark")); // 🧁
console.log(skinTone("🧑🏿‍🤝‍🧑🏿", "light")); // 🧑🏻‍🤝‍🧑🏻

Browser

// https://unpkg.com/@qit.tools/[email protected]/dist/browser/latest.min.js

document.addEventListener("DOMContentLoaded", () => {
    console.log(skinTone("🧑🏻‍🤝‍🧑🏻", "dark"));
});

API

skinTone(emoji, tone)

emoji

Type: string

tone

type SkinTone = '' | 'none' | 'light' | 'mediumLight' | 'medium' | 'mediumDark' | 'dark'

Type: SkinTone | undefined

Skin tone to use for emoji.

  • none None skin tone
  • light light skin tone, fitzpatrick type-1–2
  • mediumLight medium-light skin tone, fitzpatrick type-3
  • medium medium skin tone, fitzpatrick type-4
  • mediumDark medium-dark skin tone, fitzpatrick type-5
  • dark dark skin tone, fitzpatrick type-6

License

MIT

Unicode License Agreement

https://www.unicode.org/license.html