JWM Source Documentation

color.h File Reference

Header for the color functions. More...

Go to the source code of this file.

Enumerations

enum  ColorType {
  COLOR_TITLE_FG, COLOR_TITLE_ACTIVE_FG, COLOR_TITLE_BG1, COLOR_TITLE_BG2,
  COLOR_TITLE_ACTIVE_BG1, COLOR_TITLE_ACTIVE_BG2, COLOR_BORDER_LINE, COLOR_BORDER_ACTIVE_LINE,
  COLOR_TRAY_BG, COLOR_TRAY_FG, COLOR_TASK_FG, COLOR_TASK_BG1,
  COLOR_TASK_BG2, COLOR_TASK_ACTIVE_FG, COLOR_TASK_ACTIVE_BG1, COLOR_TASK_ACTIVE_BG2,
  COLOR_PAGER_BG, COLOR_PAGER_FG, COLOR_PAGER_ACTIVE_BG, COLOR_PAGER_ACTIVE_FG,
  COLOR_PAGER_OUTLINE, COLOR_PAGER_TEXT, COLOR_MENU_BG, COLOR_MENU_FG,
  COLOR_MENU_ACTIVE_BG1, COLOR_MENU_ACTIVE_BG2, COLOR_MENU_ACTIVE_FG, COLOR_MENU_ACTIVE_OL,
  COLOR_TRAY_UP, COLOR_TRAY_DOWN, COLOR_TASK_UP, COLOR_TASK_DOWN,
  COLOR_TASK_ACTIVE_UP, COLOR_TASK_ACTIVE_DOWN, COLOR_MENU_UP, COLOR_MENU_DOWN,
  COLOR_MENU_ACTIVE_UP, COLOR_MENU_ACTIVE_DOWN, COLOR_POPUP_BG, COLOR_POPUP_FG,
  COLOR_POPUP_OUTLINE, COLOR_TRAYBUTTON_BG, COLOR_TRAYBUTTON_FG, COLOR_CLOCK_BG,
  COLOR_CLOCK_FG, COLOR_COUNT
}
 Enumeration of colors used for various JWM components. More...

Functions

void SetColor (ColorType c, const char *value)
 Set the color to use for a component.
int ParseColor (const char *value, XColor *color)
 Parse a color.
void GetColor (XColor *c)
 Get the color pixel from red, green, and blue values.
void GetColorFromPixel (XColor *c)
 Get the RGB components from a color pixel.
void GetColorIndex (XColor *c)
 Get an RGB pixel value from RGB components.
void GetColorFromIndex (XColor *c)
 Extract the RGB components from a RGB linear pixel value.
XftColor * GetXftColor (ColorType type)
 Get an XFT color.
void InitializeColors ()
void StartupColors ()
void ShutdownColors ()
void DestroyColors ()

Variables

unsigned long colors [COLOR_COUNT]

Detailed Description

Header for the color functions.

Author:
Joe Wingbermuehle
Date:
2004-2006

Definition in file color.h.


Enumeration Type Documentation

enum ColorType

Enumeration of colors used for various JWM components.

Enumerator:
COLOR_TITLE_FG 
COLOR_TITLE_ACTIVE_FG 
COLOR_TITLE_BG1 
COLOR_TITLE_BG2 
COLOR_TITLE_ACTIVE_BG1 
COLOR_TITLE_ACTIVE_BG2 
COLOR_BORDER_LINE 
COLOR_BORDER_ACTIVE_LINE 
COLOR_TRAY_BG 
COLOR_TRAY_FG 
COLOR_TASK_FG 
COLOR_TASK_BG1 
COLOR_TASK_BG2 
COLOR_TASK_ACTIVE_FG 
COLOR_TASK_ACTIVE_BG1 
COLOR_TASK_ACTIVE_BG2 
COLOR_PAGER_BG 
COLOR_PAGER_FG 
COLOR_PAGER_ACTIVE_BG 
COLOR_PAGER_ACTIVE_FG 
COLOR_PAGER_OUTLINE 
COLOR_PAGER_TEXT 
COLOR_MENU_BG 
COLOR_MENU_FG 
COLOR_MENU_ACTIVE_BG1 
COLOR_MENU_ACTIVE_BG2 
COLOR_MENU_ACTIVE_FG 
COLOR_MENU_ACTIVE_OL 
COLOR_TRAY_UP 
COLOR_TRAY_DOWN 
COLOR_TASK_UP 
COLOR_TASK_DOWN 
COLOR_TASK_ACTIVE_UP 
COLOR_TASK_ACTIVE_DOWN 
COLOR_MENU_UP 
COLOR_MENU_DOWN 
COLOR_MENU_ACTIVE_UP 
COLOR_MENU_ACTIVE_DOWN 
COLOR_POPUP_BG 
COLOR_POPUP_FG 
COLOR_POPUP_OUTLINE 
COLOR_TRAYBUTTON_BG 
COLOR_TRAYBUTTON_FG 
COLOR_CLOCK_BG 
COLOR_CLOCK_FG 
COLOR_COUNT 

Definition at line 14 of file color.h.


Function Documentation

void DestroyColors ( )
void GetColor ( XColor *  c)

Get the color pixel from red, green, and blue values.

Parameters:
cThe structure containing the rgb values and the pixel value.
void GetColorFromIndex ( XColor *  c)

Extract the RGB components from a RGB linear pixel value.

This does the reverse of GetColorIndex.

Parameters:
cThe structure containing the rgb values and pixel value.
void GetColorFromPixel ( XColor *  c)

Get the RGB components from a color pixel.

This does the reverse of GetColor.

Parameters:
cThe structure containing the rgb values and pixel value.
void GetColorIndex ( XColor *  c)

Get an RGB pixel value from RGB components.

This is used when loading images from external sources. When doing this we need to know the color components even if we are using a color map so we just pretend to have a linear RGB colormap. This prevents calls to XQueryColor.

Parameters:
cThe structure containing the rgb values and pixel value.
XftColor* GetXftColor ( ColorType  type)

Get an XFT color.

Parameters:
typeThe color whose XFT color to get.
Returns:
The XFT color.
void InitializeColors ( )
int ParseColor ( const char *  value,
XColor *  color 
)

Parse a color.

Parameters:
valueThe color name or hex value.
colorThe color return value (with pixel and components filled).
Returns:
1 on success, 0 on failure.
void SetColor ( ColorType  c,
const char *  value 
)

Set the color to use for a component.

Parameters:
cThe component whose color to set.
valueThe color to use.
void ShutdownColors ( )
void StartupColors ( )

Variable Documentation

unsigned long colors[COLOR_COUNT]