Colours.

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
byrons
Posts: 17
Joined: Thu Jan 27, 2005 6:30 am
Contact:

Colours.

Post by byrons »

Hey all,

Not sure if this has been done before, if so, damn. :)

Today I was getting a bit fed up trying to match colours when I wanted to create the awesome 'Fire' effect, so I decided to arrange my colours a bit better.


This is purely cosmetic and will create no additional functionality to the wonderful cacti.
I take no responsibility for these instructions, USE AT YOUR OWN RISK :p (always wanted to say that)



1. With PHPMyAdmin, drop the table 'colors' and import the new colors.sql

With your favourite editor (php expert editor).

2. Open "color.php" located in your cacti root.


Change Line 131:


From This:

Code: Select all

$color_list = db_fetch_assoc("select * from colors order by hex");


To This:

Code: Select all

$color_list = db_fetch_assoc("select * from colors order by id"); 


3 . Open "html_form.php" located in in "/cacti/lib"


Change line 370:


From This:

Code: Select all

$colors_list = db_fetch_assoc("select id,hex from colors order by hex desc");


To This:

Code: Select all

$colors_list = db_fetch_assoc("select id,hex from colors order by id");  

Make sure you update your Graph Templates with your new colours :)


Here are some screen shots showing you what I mean.

Before
Image

After
Image
Attachments
Before Drop Box
Before Drop Box
before_drop.jpg (29.48 KiB) Viewed 34078 times
After Drop Box
After Drop Box
after_drop.jpg (29.94 KiB) Viewed 34079 times
colors.txt
Colours !!!
(5.08 KiB) Downloaded 2291 times
byrons
Posts: 17
Joined: Thu Jan 27, 2005 6:30 am
Contact:

Post by byrons »

Hmm, have I put this in the right forum category?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Oooooooooo, I like...

Never really paid that close attention to the colors, but often wondered why they where so mixed up.

Btw, if some removes or adds colors, you will still have problems with the order, because of the ID. I will look, maybe I can talk Ian into just having a big list that is generated automatically, instead of storing it in the database.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
byrons
Posts: 17
Joined: Thu Jan 27, 2005 6:30 am
Contact:

Post by byrons »

The main objective of this was to create all the colours I would need and then import the table repeating the process if I needed to add more colours :)

I do like your idea, another way is to have the additional id's editable from within Cacti.
User avatar
cjennings_cr
Posts: 20
Joined: Thu Jan 06, 2005 8:09 am
Contact:

Post by cjennings_cr »

If you want - here is the entire WWW safe color set - sorted by hue. This is the SQL code that I imported.
Attachments
Colors-small.JPG
Colors-small.JPG (105.88 KiB) Viewed 32938 times
colors.txt
(18.2 KiB) Downloaded 2658 times
mgb
Cacti User
Posts: 124
Joined: Mon Jun 21, 2004 4:06 am
Location: North of the Netherlands

Post by mgb »

These little things make cacti from average to perfect. Great work guys.

Michael :lol:
barracuda
Posts: 9
Joined: Fri May 12, 2006 11:09 am

Color of font in drop down list

Post by barracuda »

I've implemented the 327 color list from this thread ( with the sorting ), but you can't read the hex on darker colors because of the font color being black.

How can you change the color of the font for the hex number on the color list?
Or is this done through code?


Any help on this would be appreciated. Thanks.
dennett
Posts: 3
Joined: Mon Aug 21, 2006 1:52 am

Cacti Colours

Post by dennett »

Thanks guys,

A simple but very useful change.

Great work!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Find some of my ideas for a solution here: http://forums.cacti.net/viewtopic.php?t=18869
Reinhard
carolina
Posts: 4
Joined: Sun Oct 19, 2008 5:48 am
Location: home or telkom
Contact:

Post by carolina »

wow, very useful, makes my graph more colourful than before..
thanks :D
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests