Tag: Colors
-
Adjust text color to be readable on light and dark backgrounds of user interfaces
Written by
Most modern user interfaces are supporting different color schemes for day and night: the so called light and dark modes. Selecting a text color for each of those modes is not a big deal and it’s the way to go when designing the user interface. In some cases, the text color is driven by the…
-
Black or white text on a colour background?
Written by
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
Written by
A neat collection of useful methods to convert colors between different color spaces is available on GitHub (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 the class,…