Colours.

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

Moderators: Moderators, Developers

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

Colours.

#1 Post by byrons » Fri Feb 04, 2005 2:09 pm

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.jpg
Before Drop Box
before_drop.jpg (29.48 KiB) Viewed 28393 times
after_drop.jpg
After Drop Box
after_drop.jpg (29.94 KiB) Viewed 28394 times
colors.txt
Colours !!!
(5.08 KiB) Downloaded 1701 times

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

#2 Post by byrons » Fri Feb 04, 2005 2:10 pm

Hmm, have I put this in the right forum category?

User avatar
rony
Developer/Forum Admin
Posts: 6016
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

#3 Post by rony » Fri Feb 04, 2005 3:03 pm

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:

#4 Post by byrons » Fri Feb 04, 2005 3:50 pm

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:

#5 Post by cjennings_cr » Tue Oct 04, 2005 8:46 am

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 27253 times
colors.txt
(18.2 KiB) Downloaded 1868 times

mgb
Cacti User
Posts: 124
Joined: Mon Jun 21, 2004 4:06 am
Location: North of the Netherlands

#6 Post by mgb » Wed Oct 05, 2005 2:21 am

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

#7 Post by barracuda » Wed Aug 23, 2006 10:59 am

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

#8 Post by dennett » Wed Sep 06, 2006 9:18 pm

Thanks guys,

A simple but very useful change.

Great work!

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#9 Post by gandalf » Fri Dec 29, 2006 1:44 pm

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:

#10 Post by carolina » Sun Oct 19, 2008 5:53 am

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

Post Reply