Coder Social home page Coder Social logo

skin-tone's Introduction

skin-tone Build Status

Change the skin tone of an emoji πŸ‘ŒπŸ‘ŒπŸ»πŸ‘ŒπŸΌπŸ‘ŒπŸ½πŸ‘ŒπŸΎπŸ‘ŒπŸΏ

The Fitzpatrick scale is used to specify skin tones for emoji characters which represent humans.

Install

$ npm install --save skin-tone

Usage

const skinTone = require('skin-tone');

skinTone('πŸ‘', skinTone.BROWN);
//=> 'πŸ‘πŸΎ'

// or by using the constant value directly
skinTone('πŸ‘', 4);
//=> 'πŸ‘πŸΎ

skinTone('πŸ‘', skinTone.WHITE);
//=> 'πŸ‘πŸ»'

// can also remove skin tone
skinTone('πŸ‘πŸΎ', skinTone.NONE);
//=> 'πŸ‘'

// just passes it through when not supported
skinTone('πŸ¦„', skinTone.DARK_BROWN);
//=> 'πŸ¦„'

API

skinTone(emoji, type)

emoji

Type: string

Emoji to modify.

type

Type: number
Values:

  • skinTone.NONE | 0: (Removes skin tone)
  • skinTone.WHITE | 1: 🏻 (Fitzpatrick Type-1–2)
  • skinTone.CREAM_WHITE | 2: 🏼 (Fitzpatrick Type-3)
  • skinTone.LIGHT_BROWN | 3: 🏽 (Fitzpatrick Type-4)
  • skinTone.BROWN | 4: 🏾 (Fitzpatrick Type-5)
  • skinTone.DARK_BROWN | 5: 🏿 (Fitzpatrick Type-6)

License

MIT Β© Sindre Sorhus

skin-tone's People

Contributors

sindresorhus avatar markogresak avatar

Watchers

James Drew avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.