Options
All
  • Public
  • Public/Protected
  • All
Menu

Smartface Color Util module

author

Alper Ozisik alper.ozisik@smartface.io

copyright

Smartface 2018

see

tinycolor2

example
import Color = require('@smartface/native/ui/color');
import colorUtil from '@smartface/extension-utils/lib/color';
colorUtil.rgb(Color.RED); //#ff0000
colorUtil.rgb(Color.BLUE).tinycolor.darken().toHexString(); //'#0000cc'

Index

Functions

Properties

Functions

rgb

  • rgb(color: ColorImpl): string
  • Returns 6 digit hexadecimal string from Color object. Does not start with # character

    Parameters

    • color: ColorImpl

    Returns string

rgba

  • rgba(color: ColorImpl): string
  • Returns 8 digit hexadecimal string from Color object. Does not start with # character

    static
    method
    params

    {UI.Color} color - Smartface Color Object, without gradient

    Parameters

    • color: ColorImpl

    Returns string

    Hexadecimal RGBA representation of the color

argb

  • argb(color: ColorImpl): string
  • Returns 8 digit hexadecimal string from Color object. Does not start with # character

    static
    method
    params

    {UI.Color} color - Smartface Color Object, without gradient

    Parameters

    • color: ColorImpl

    Returns string

    Hexadecimal ARGB representation of the color

tinycolor

  • tinycolor(color: ColorImpl): InstanceType<typeof TinyColor>
  • Creates a tinycolor object from UI.Color

    method
    static
    params

    {UI.Color} color - Smartface Color Object, without gradient

    see

    TinyColor

    Parameters

    • color: ColorImpl

    Returns InstanceType<typeof TinyColor>

Properties

default

default: { rgb: (color: ColorImpl) => string; rgba: (color: ColorImpl) => string; argb: (color: ColorImpl) => string; tinycolor: (color: ColorImpl) => InstanceType<typeof TinyColor> }

Type declaration

  • rgb: (color: ColorImpl) => string
      • (color: ColorImpl): string
      • Returns 6 digit hexadecimal string from Color object. Does not start with # character

        Parameters

        • color: ColorImpl

        Returns string

  • rgba: (color: ColorImpl) => string
      • (color: ColorImpl): string
      • Returns 8 digit hexadecimal string from Color object. Does not start with # character

        static
        method
        params

        {UI.Color} color - Smartface Color Object, without gradient

        Parameters

        • color: ColorImpl

        Returns string

        Hexadecimal RGBA representation of the color

  • argb: (color: ColorImpl) => string
      • (color: ColorImpl): string
      • Returns 8 digit hexadecimal string from Color object. Does not start with # character

        static
        method
        params

        {UI.Color} color - Smartface Color Object, without gradient

        Parameters

        • color: ColorImpl

        Returns string

        Hexadecimal ARGB representation of the color

  • tinycolor: (color: ColorImpl) => InstanceType<typeof TinyColor>
      • (color: ColorImpl): InstanceType<typeof TinyColor>
      • Creates a tinycolor object from UI.Color

        method
        static
        params

        {UI.Color} color - Smartface Color Object, without gradient

        see

        TinyColor

        Parameters

        • color: ColorImpl

        Returns InstanceType<typeof TinyColor>

Generated using TypeDoc