From the course: PHP Tips, Tricks, and Techniques

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Generate harmonious color tones

Generate harmonious color tones

- [Instructor] Hi, I'm David Powers and welcome to this week's edition of PHP Tips, Tricks and Techniques designed to help you become a smarter, more productive PHP developer. This week's technique shows how to generate harmonious color tones from a base color, this can be extremely useful for creating a color scheme for a website or even for decorating your home. Let's start with a pale blue, this color can be expressed using RGB notation which specifies the intensity of its red, green, and blue channels. A simple way to generate a lighter tone is to reduce the colors opacity. In RGBA notation, the fourth number is a value between zero and one, zero being totally transparent and one fully opaque. Letting the white background show through simulates a lighter tone. In effect the blue and white are being blended. When the same RGBA value is placed over a black background, it results in a darker tone and this works with any background. Changing the background to red gives us a shade of…

Contents