/sources/themewizard.php

Description
Functions
calculate_dynamic_css_colours (line 616)

Augment an array of CSS colours with colours that are derived actually inside the CSS-sheets.

  • return: A pair: extended map of colours, colour expression landscape
array calculate_dynamic_css_colours (array $colours)
  • array $colours: Map of colours.
calculate_theme (line 417)

Calculate some component relating to a theme from a colour seed.

  • return: Image resource OR A pair: extended map of colours, colour expression landscape
mixed calculate_theme (string $seed, [ID_TEXT $show = 'colours'], [?boolean $dark = NULL], [?array $colours = NULL], [?array $landscape = NULL], [?LANGUAGE_NAME $lang = NULL])
  • string $seed: Colour seed.
  • ID_TEXT $show: What to generate ('colours', or the name of a theme image).
  • ?boolean $dark: Whether it will be a dark theme (NULL: autodetect).
  • ?array $colours: The colour map to use (NULL: compute).
  • ?array $landscape: The computed colour landscape to use (NULL: compute).
  • ?LANGUAGE_NAME $lang: The language to work in (NULL: default).
execute_css_colour_expression (line 774)

Execute CSS colour expression.

  • return: RRGGBB colour or possibly just a number (NULL: answer cannot be computed).
?string execute_css_colour_expression (mixed $expression, array $colours)
  • mixed $expression: Expression tree (array) OR leaf (string).
  • array $colours: Known colours at this point.
find_theme_image_themewizard_preview (line 57)

Called by find_theme_image to allow on-the-fly previewing of what theme wizard output would look like.

  • return: URL to image (NULL: use standard one, this one is not theme wizard influenced).
?URLPATH find_theme_image_themewizard_preview (ID_TEXT $id)
  • ID_TEXT $id: The theme image ID
fix_colour (line 928)

Make sure a colour component fits within the necessary range (0<=x<256).

  • return: Constrained colour component.
integer fix_colour (mixed $x)
  • mixed $x: Colour component (float or integer).
generate_gradiant (line 1198)

Generate a gradiant for a theme.

  • return: The image
resource generate_gradiant (string $top, string $bottom)
  • string $top: Colour for the top.
  • string $bottom: Colour for the bottom.
generate_logo (line 93)

Generate a logo from the template.

  • return: The image resource.
resource generate_logo (string $name, string $slogan, [boolean $raw = false], [?string $theme = NULL], [string $use = 'logo-template'])
  • string $name: The site name.
  • string $slogan: The site slogan.
  • boolean $raw: Whether to output the logo to the browser, destroy then image, and exit the script (i.e. never returns)
  • ?string $theme: The theme to use the logo template from (NULL: default root zone theme).
  • string $use: The logo img file to base upon.
generate_recoloured_image (line 1242)

Generate a theme image by converting an existing one to a new colour scheme via intelligent blending correlation.

  • return: The image
resource generate_recoloured_image (mixed $path, string $colour_a_orig, string $colour_a_new, string $colour_b1_orig, string $colour_b1_new, [?string $colour_b2_orig = NULL], [?string $colour_b2_new = NULL], [string $gradiant_direction = 'vertical'], [?array $pixel_x_start_array = NULL], [integer $gradiant_offset = 0], [boolean $end_array = false])
  • mixed $path: The image path OR a preloaded GD image resource
  • string $colour_a_orig: The colour code of what we have as our "minor" colour (often a border colour)
  • string $colour_a_new: The colour code of what we want as our "minor" colour (often a border colour)
  • string $colour_b1_orig: The colour code of what we have as our first major colour (often the only major colour)
  • string $colour_b1_new: The colour code of what we want as our first major colour (often the only major colour)
  • ?string $colour_b2_orig: The colour code of what we have as our second major colour (the gradiant target, at the bottom/right of the image) (NULL: not gradianted)
  • ?string $colour_b2_new: The colour code of what we want as our second major colour (the gradiant target, at the bottom/right of the image) (NULL: not gradianted)
  • string $gradiant_direction: The directional code for the gradiant
  • ?array $pixel_x_start_array: An array that is used to limit where we do our conversion on. It specifies, for each y-offset, the x-offset we start from (NULL: no such limitation)
  • integer $gradiant_offset: What the gradiant assumed start-position will be offset by (in the gradiant direction).
  • boolean $end_array: Whether the pixel_x_start array is actually an end array.
hsv_to_rgb (line 994)

Convert HSV colour components to an RGB colour. Based on publically distributed code fragments which were themselves based on others: reasonably assumed as public domain.

  • return: RGB colour.
string hsv_to_rgb (float $h, float $s, float $v)
  • float $h: H component
  • float $s: S component
  • float $v: V component
init__themewizard (line 24)

Standard code module initialisation function.

void init__themewizard ()
make_theme (line 219)

Make a theme. Note that this will trigger the AFM.

void make_theme (string $themename, string $seed, boolean $use, [?boolean $dark = false], [boolean $inherit_css = false])
  • string $themename: Name of the theme.
  • string $seed: Seed colour to use.
  • boolean $use: Whether to use the theme immediately.
  • ?boolean $dark: Whether it will be a dark theme (NULL: autodetect).
  • boolean $inherit_css: Whether to inherit the CSS, for easier theme upgrading.
parse_css_colour_expression (line 688)

Convert a textual CSS colour expression into an expression tree.

  • return: Expression tree (NULL: not real).
?array parse_css_colour_expression (string $textual)
  • string $textual: Textual expression.
re_hue_image (line 1100)

Generate a theme image by converting an existing one to a new colour scheme via re-hueing.

  • return: The image
resource re_hue_image (mixed $path, string $seed)
  • mixed $path: The image path OR a preloaded GD image resource
  • string $seed: The colour code of our hue
rgb_to_hsv (line 939)

Convert an RGB colour to HSV colour components. Based on publically distributed code fragments which were themselves based on others: reasonably assumed as public domain.

  • return: Triplet of (0-255) components: H, S, V
array rgb_to_hsv (string $rgb)
  • string $rgb: RRGGBB colour.
themewizard_script (line 365)

Output a theme component straight to the browser.

void themewizard_script ()
theme_wizard_colours_to_sheet (line 1060)

Convert an array of CSS colours into an actual CSS sheet.

  • return: The sheet
string theme_wizard_colours_to_sheet (string $sheet, array $landscape)
  • string $sheet: Array of colours, template map style.
  • array $landscape: The colour expression landscape which we'll make substitutions using.
_parse_css_colour_expression (line 710)

Convert CSS colour tokens into an expression tree.

  • return: Expression tree.
array _parse_css_colour_expression (array $tokens)
  • array $tokens: Tokens.

Documentation generated on Sun, 02 Jan 2011 23:27:01 +0000 by phpDocumentor 1.4.3