Maintainer | hapytexeu+gh@gmail.com |
---|---|
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
For several emoji, one can specify the color of the skin of the person(s) of the emoji. This module defines the skin color modifiers together with its values on the Fitzpatrick scale.
Synopsis
- data SkinColorModifier
- = Light
- | MediumLight
- | Medium
- | MediumDark
- | Dark
- type OptionalSkinColorModifier = Maybe SkinColorModifier
- fromFitzpatrick :: Integral i => i -> Maybe SkinColorModifier
- isSkinColorModifier :: Char -> Bool
- class UnicodeText a => WithSkinColorModifierUnicodeText a where
- withSkinModifier :: a -> SkinColorModifier -> Text
- withOptionalSkinModifier :: a -> OptionalSkinColorModifier -> Text
- withoutOptionalSkinModifier :: Text -> Maybe (a, OptionalSkinColorModifier)
- withSkinModifier' :: Text -> SkinColorModifier -> Text
- withOptionalSkinModifier' :: Text -> OptionalSkinColorModifier -> Text
- withoutOptionalSkinModifier' :: Text -> (Text, OptionalSkinColorModifier)
- pattern FitzpatrickI :: SkinColorModifier
- pattern FitzpatrickII :: SkinColorModifier
- pattern FitzpatrickIII :: SkinColorModifier
- pattern FitzpatrickIV :: SkinColorModifier
- pattern FitzpatrickV :: SkinColorModifier
- pattern FitzpatrickVI :: SkinColorModifier
Skin color modifier
data SkinColorModifier Source #
Some emoji deal with people. One can change the color of the skin with the
SkinColorModifier
. For the skin color, the /Fitzpatrick scale/ is used.
A numerical classification system for skin types.
Light | An emoji modifier that applies Fitzpatrick skin type one or two to the Emoji. |
MediumLight | An emoji modifier that applies Fitzpatrick skin type three to the Emoji. |
Medium | An emoji modifier that applies Fitzpatrick skin type four to the Emoji. |
MediumDark | An emoji modifier that applies Fitzpatrick skin type five to the Emoji. |
Dark | An emoji modifier that applies Fitzpatrick skin type six to the Emoji. |
Instances
type OptionalSkinColorModifier = Maybe SkinColorModifier Source #
For emoji often the skin color is optional: in case there is no skin color specified, the emoji have often a yellow skin color.
:: Integral i | |
=> i | The given Fitzpatrick skin type. |
-> Maybe SkinColorModifier | The corresponding |
Convert the given Fitzpatrick skin type to the corresponding
SkinColorModifier
wrapped in a Just
, if no such SkinColorModifier
exists, Nothing
is returned.
:: Char | The given |
-> Bool |
|
Check if the given Char
acter is a skin color modifier.
Create emoji with a SkinColorModifier
class UnicodeText a => WithSkinColorModifierUnicodeText a where Source #
A typeclass where one can specify that the object can be rendered with a given skin color modifier.
Nothing
:: a | The given item to render to a unicode |
-> SkinColorModifier | The given skin color modifier to apply. |
-> Text | The corresponding |
Apply the given SkinColorModifier
to the item and obtain a Text
object where the item
has been modified with the SkinColorModifier
.
withOptionalSkinModifier Source #
:: a | The given item to render to a unicode |
-> OptionalSkinColorModifier | The given optional skin color modifier. |
-> Text | The corresponding |
Apply the given SkinColorModifier
to the item given it is not Nothing
such that
the object is rendered with the given skin color modifier.
withoutOptionalSkinModifier Source #
:: Text | The given |
-> Maybe (a, OptionalSkinColorModifier) | An optional 2-tuple with the item that has been read, and an optional |
Convert the given Text to an item with an OptionalSkinColorModifier
that might
have been applied.
Instances
:: Text | The given |
-> SkinColorModifier | The given |
-> Text | The given |
Append the given Text
object with the Unicode character to modify its skin color.
withOptionalSkinModifier' Source #
:: Text | The given |
-> OptionalSkinColorModifier | The given |
-> Text | The given |
withoutOptionalSkinModifier' Source #
:: Text | The given |
-> (Text, OptionalSkinColorModifier) | A 2-tuple where the first item is the remaining |
Convert the given Text
object to a wrapped Text
object with an OptionalSkinColorModifier
.
Pattern synonyms for the SkinColorModifier
elements
pattern FitzpatrickI :: SkinColorModifier Source #
The SkinColorModifier
that corresponds to type one of the /Fitzpatrick
scale/.
pattern FitzpatrickII :: SkinColorModifier Source #
The SkinColorModifier
that corresponds to type two of the /Fitzpatrick
scale/.
pattern FitzpatrickIII :: SkinColorModifier Source #
The SkinColorModifier
that corresponds to type three of the /Fitzpatrick
scale/.
pattern FitzpatrickIV :: SkinColorModifier Source #
The SkinColorModifier
that corresponds to type four of the /Fitzpatrick
scale/.
pattern FitzpatrickV :: SkinColorModifier Source #
The SkinColorModifier
that corresponds to type five of the /Fitzpatrick
scale/.
pattern FitzpatrickVI :: SkinColorModifier Source #
The SkinColorModifier
that corresponds to type six of the /Fitzpatrick
scale/.