Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Banner Colors

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Banner Colors

Post by beteljuice »

rp4111 wrote:I'm lost on the "imagecreatetruecolor(" for the banner. It looks like to me I have to input color codes into the code? :shock: ..
OK ...

The code shown in the other thread is a cut 'n' paste replacement for the similar existing part in the 'standard' banner code. BUT remember to edit the bits as stated that relate to your background image.

You should already have some 'color' allocations - These are (almost) nothing to do with pictures !

Having created the truecolor (or otherwise) blank canvass, you then define the background colour (whether it is used or not).
Then you define colours you want to 'paint' with - eg. text / data

Here is part of my declarations for my customised banner:

Code: Select all

// Set colors we want to use...
	$background_color   = imagecolorallocate($im, 0x00, 0x00, 0x00); // Black
	$white   = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
	$green              = imagecolorallocate($im, 0x00, 0xff, 0x00);
	$blue               = imagecolorallocate($im, 122, 208, 248);
	$red                = imagecolorallocate($im, 0xff, 0x00, 0x00);
	$turq = imagecolorallocate($im,100,250,250);  // TURQ  
	$yellow = imagecolorallocate($im,255,255,0);  // YELLOW  
Notes:
You can name a colour whatever you want ! - eg. $mywhitetitlecolor = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
The numbers maybe decimal or hexadecimal and relate to the Red / Green / Blue components of the colour.

More information here: http://us.php.net/imagecolorallocate

So if you wanted to replace ALL the red text in your banner with eg. yellow, the cheats way of doing it would be to define $red with the values for yellow ! - this saves having to search through the code looking for and replacing $red with your new variable name. eg. $yellow.

Here is typical part of the code using a defined 'color': imageWriteString($im, $size, $text, $green, "right", 1);


Has that lightened your darkness :?
Image
......................Imagine, what you will KNOW tomorrow !
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Banner Colors

Post by gemini06720 »

David, why oh why do you feel the banner/logo image has to be left out (placed out) of the page content? :(

What is wrong (in your mind and eyes) in me suggesting that the banner/logo be placed inside the '<div id="content">' page wrapper? :? Could you please explain your reasoning... I understand that the banner/logo will still show on the page, but, as I wrote previously, the banner/logo is not in the page.
daj wrote:(blue is new)
<body>
<div align="center"><img src="http://westspringfieldwx.com/myimages/banner.jpg" width="800" height="200" border="1"></div>
<div id="content">
<table align="center">
<tr>
<td colspan="4" class="td_navigation_bar">:<a href="index.htm">now</a>::<a href="gauges.htm">gauges</a>::<a href="today.htm">today</a>::<a href="yesterday.htm">yesterday</a>::<a href="record.htm">records</a>::<a href="trends.htm">trends</a>:</td>
</tr>
</table>
If the 'table' tag is within the <div id="content"> page wrapper, then the 'table' tag does not need a centering tag - making the table width 100% (as is done in the following lines of code) will produce the same results while keeping the page standardized... :(
rp4111
Posts: 62
Joined: Wed 30 Dec 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Banner Colors

Post by rp4111 »

Beteljuice,
Your referring to the text color of the banner, correct? My problem is the background image on the banner has some really horrible colors! Although it's good you went over how to change the text color now because I would have needed help with that next!
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Banner Colors

Post by beteljuice »

My problem is the background image on the banner has some really horrible colors!
That is why we need to use:

$im = @imagecreatetruecolor($SITE['image_width'], $SITE['image_height']) or die("Cannot Initialize new GD image stream");

BUT ... if you have said that you want your output banner in .gif format then it will be reduced to 'best fit' 256 colours ;)
Image
......................Imagine, what you will KNOW tomorrow !
rp4111
Posts: 62
Joined: Wed 30 Dec 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Banner Colors

Post by rp4111 »

Got ya! Looks good now. Everyone's help is much appreciated.
Post Reply