Really Big Colour Code: 117313504


Re: Really Big Colour Code: 117313504
#20
Some time ago I developed my own algorithm to generate edge colors, and applied it to all the colors in LDConfig. I like the results, but that's just a personal preference.

Rather than basing a calculation on the RGB values, I convert them to HSL (Hue, Saturation, Luminance) and transform that instead. (Conveniently, Windows provides two functions ColorRGBToHLS and ColorHLSToRGB, even if they did swap two of the parameters around!) This allows me to keep the hue unchanged, which I think was one of the observations made earlier in this thread.

To calculate the edge color:
  • Use the luminance value to categorize the color as "dark", "dark-ish", "light-ish" or "light" (respectively <85, <112, <159, >=160).
  • Adjust the luminance according to which band it falls in:
    "dark" + 90
    "dark-ish" + 45
    "light-ish" -45
    "light" - 90
  • Halve the stauration
I have this built into a (not very pretty!) Excel spreadsheet where I can just paste the contents of LDConfig into the front sheet, and it spits out the recalculated file at the back. If anybody wants to have a play with it -- and even improve it! -- I'll try and tidy it up a bit and post a copy on here.

--
Martin James
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Re: Really Big Colour Code: 117313504 - by Martin James - 2013-02-12, 8:51

Forum Jump:


Users browsing this thread: 2 Guest(s)