Defines | Typedefs | Functions

nsColor.h File Reference

#include "gfxCore.h"
#include "nscore.h"
Include dependency graph for nsColor.h:
This graph shows which files directly or indirectly include this file:

Defines

#define NS_RGB(_r, _g, _b)   ((nscolor) ((255 << 24) | ((_b)<<16) | ((_g)<<8) | (_r)))
#define NS_RGBA(_r, _g, _b, _a)   ((nscolor) (((_a) << 24) | ((_b)<<16) | ((_g)<<8) | (_r)))
#define NS_GET_R(_rgba)   ((PRUint8) ((_rgba) & 0xff))
#define NS_GET_G(_rgba)   ((PRUint8) (((_rgba) >> 8) & 0xff))
#define NS_GET_B(_rgba)   ((PRUint8) (((_rgba) >> 16) & 0xff))
#define NS_GET_A(_rgba)   ((PRUint8) (((_rgba) >> 24) & 0xff))
#define FAST_DIVIDE_BY_255(target, v)

Typedefs

typedef PRUint32 nscolor

Functions

PRBool NS_HexToRGB (const nsString &aBuf, nscolor *aResult)
nscolor NS_ComposeColors (nscolor aBG, nscolor aFG)
PRBool NS_LooseHexToRGB (const nsString &aBuf, nscolor *aResult)
PRBool NS_ColorNameToRGB (const nsAString &aBuf, nscolor *aResult)
nscolor NS_HSL2RGB (float h, float s, float l)

Define Documentation

#define FAST_DIVIDE_BY_255 (   target,
  v 
)
Value:
PR_BEGIN_MACRO                                   \
    unsigned tmp_ = v;                             \
    target = ((tmp_ << 8) + tmp_ + 255) >> 16;     \
  PR_END_MACRO
#define NS_GET_A (   _rgba  )     ((PRUint8) (((_rgba) >> 24) & 0xff))
#define NS_GET_B (   _rgba  )     ((PRUint8) (((_rgba) >> 16) & 0xff))
#define NS_GET_G (   _rgba  )     ((PRUint8) (((_rgba) >> 8) & 0xff))
#define NS_GET_R (   _rgba  )     ((PRUint8) ((_rgba) & 0xff))
#define NS_RGB (   _r,
  _g,
  _b 
)    ((nscolor) ((255 << 24) | ((_b)<<16) | ((_g)<<8) | (_r)))
#define NS_RGBA (   _r,
  _g,
  _b,
  _a 
)    ((nscolor) (((_a) << 24) | ((_b)<<16) | ((_g)<<8) | (_r)))

Typedef Documentation

typedef PRUint32 nscolor

Function Documentation

PRBool NS_ColorNameToRGB ( const nsAString aBuf,
nscolor aResult 
)
nscolor NS_ComposeColors ( nscolor  aBG,
nscolor  aFG 
)
PRBool NS_HexToRGB ( const nsString &  aBuf,
nscolor aResult 
)
nscolor NS_HSL2RGB ( float  h,
float  s,
float  l 
)
PRBool NS_LooseHexToRGB ( const nsString &  aBuf,
nscolor aResult 
)