WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search


Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder



Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Colors - Make a hex color lighter
Categories : PHP, Colors Click here to Update Your Picture
Justin French
Date : May 04th 2003
Grade : 4 of 5 (graded 8 times)
Viewed : 10992
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Justin French
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

Create a lighter shade of a hex color:

<?
function hexLighter($hex,$factor = 30)
        {
        $new_hex = '';
        
        $base['R'] = hexdec($hex{0}.$hex{1});
        $base['G'] = hexdec($hex{2}.$hex{3});
        $base['B'] = hexdec($hex{4}.$hex{5});
        
        foreach ($base as $k => $v)
                {
                $amount = 255 - $v;
                $amount = $amount / 100;
                $amount = round($amount * $factor);
                $new_decimal = $v + $amount;
        
                $new_hex_component = dechex($new_decimal);
                if(strlen($new_hex_component) < 2)
                        { $new_hex_component = "0".$new_hex_component; }
                $new_hex .= $new_hex_component;
                }
                
        return $new_hex;        
        }
?>

Example, making a new colour 50% lighter than the first:
<?
$myCol = "FFCC99";
$newCol = hexLighter($myCol, 50);
?>



Color - making a hex color darker
Categories : PHP, Colors
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
Download manager - A PHP script for adding a download page to any site.It also enables you track the no. of downloads.
Categories : PHP, Content Management, Filesystem, Databases, MySQL
SubmitForce URL power submitter (searchengine submission class)
Categories : PHP, Search Engines, URLs, PHP Classes
Class to convert any document, that can be read by MS Word, to another format supported by Word.
Categories : PHP Classes, PHP, Windows 2000, Microsoft Word, WinNT
Accessing GET and PUT variables with HTTP_GET_VARS on Win2K.
Categories : PHP, Windows 2000, Variables
How to check if JavaScript is enabled on a remote browser with PHP
Categories : PHP, Java Script
minus - subtract arrays. Send two arrays and get an array with the operation A-B, elements on A that are not included on B.
Categories : PHP, Arrays, Algorithms
Convert MYSQL timestamp (14) fields back to UNIX epoch (seconds) format for display with the date() function. "revertTimeStamp($timestamp)"
Categories : PHP, Date Time, MySQL
How to make sure Sybase reads the correct Sybase interfaces file?
Categories : Sybase, PHP
PHP Tester - Lets you test php code from a browser (modification).
Categories : PHP, HTML and PHP, Testing
Link Manager for Link Exchangers
Categories : PHP, PHP Classes, Databases, MySQL, CURL
WebFTP: This tool can be used to access FTP sites from behind any firewall or proxy.
Categories : PHP, FTP
A template script to provide the ability to get the next or previous n records from a MySQL database.
Categories : Databases, PHP, MySQL
mhash -- Compute hash
Categories : PHP, PHP Functions, mhash