Package pygtk_chart :: Module basics
[hide private]
[frames] | no frames]

Module basics

source code

This module contains simple functions needed by all other modules.

Author: Sven Festersen (sven@sven-festersen.de)

Functions [hide private]
 
is_in_range(x, (xmin, xmax))
Use this method to test whether xmin <= x <= xmax.
source code
 
intersect_ranges(range_a, range_b) source code
 
get_center(rect)
Find the center point of a rectangle.
source code
 
color_rgb_to_cairo(color)
Convert a 8 bit RGB value to cairo color.
source code
 
color_html_to_cairo(color)
Convert a html (hex) RGB value to cairo color.
source code
 
color_list_from_file(filename)
Read a file with one html hex color per line and return a list of cairo colors.
source code
 
show_text(context, rect, x, y, text, font, size, slant=0, weight=0, underline=False, reference_point=0) source code
Variables [hide private]
  REF_BOTTOM_LEFT = 0
  REF_TOP_LEFT = 1
  REF_TOP_RIGHT = 2
  REF_BOTTOM_RIGHT = 4
Function Details [hide private]

is_in_range(x, (xmin, xmax))

source code 

Use this method to test whether xmin <= x <= xmax.

Parameters:
  • xmin (number)
  • x (number)
  • xmax (number)

get_center(rect)

source code 

Find the center point of a rectangle.

Parameters:
  • rect (gtk.gdk.Rectangle) - The rectangle.
Returns:
A (x, y) tuple specifying the center point.

color_rgb_to_cairo(color)

source code 

Convert a 8 bit RGB value to cairo color.

Parameters:
  • color (a triple of integers between 0 and 255) - The color to convert.
Returns:
A color in cairo format.

color_html_to_cairo(color)

source code 

Convert a html (hex) RGB value to cairo color.

Parameters:
  • color (html color string) - The color to convert.
Returns:
A color in cairo format.