Tag: ColorUtils
-
Black or white text on a colour background?
How to calculate programmatically whether black text or white text is more readable on a colour background? Here are some algorithms to calculate the brightness of a color. The example code is written in PHP, but you should be able to adapt the code examples to any other programming language. All of the algorithmns are…
-
PHP ColorUtils
A neat collection of useful methods to convert colors between different color spaces is available on GitHub call ColorConverter (MIT License). It can convert any values between RGB, HSL, CMYK, YUV and HEX colors. I created a ready-to-use php class out of this method collection: https://github.com/mixable/color-utils Usage The methods itself are mostly self-explaining. To use…