How do I determine darker or lighter color variant of a given color?
Posted
by Nidonocu
on Stack Overflow
See other posts from Stack Overflow
or by Nidonocu
Published on 2008-09-18T22:27:34Z
Indexed on
2010/04/22
10:43 UTC
Read the original article
Hit count: 179
Given a source color of any hue by the system or user, I'd like a simple algorithm I can use to work out a lighter or darker variants of the selected color. Similar to effects used on Windows Live Messenger for styling the user interface.
Language is C# with .net 3.5.
Responding to comment: Color format is (Alpha)RGB. With values as bytes or floats.
Marking answer: For the context of my use (a few simple UI effects), the answer I'm marking as accepted is actually the most simple for this context. However, I've given up votes to the more complex and accurate answers too. Anyone doing more advanced color operations and finding this thread in future should definitely check those out. Thanks SO. :)
© Stack Overflow or respective owner