Thanks everybody, based on the above I'm going with this for the time being:
I'll be using this only for decoded colors and to compliment missing edge info from COLOUR tags. At some point later on I probably make an option for global calculated edge colors using a HSL transformation like Allen and Martin suggest / use.
edit:
Playing some more made me change the above to:
Because I like it a bit more, I've also tried Travis' suggestion (scaling by 40% up or down):
But I found the contrast isn't high enough resulting in disappearing edges under certain angles (caused by shading). The other methods seem less affected by that effect, maybe that's the reason Alan choose 0.4 (although i agree with Travis on it being to red in his example, hence using 0.5).
Using "rgb2hsl -> adjust -> hsl2rgb" will probably be the best solution, but I havn't tried that yet.
note: the called functions limit rgb values to 0.0 .. 1.0)
Code:
edgeCol.inc(mainCol.getBrightness()>0.5 ? -0.6 : 0.6);
edgeCol.a=1.0;
I'll be using this only for decoded colors and to compliment missing edge info from COLOUR tags. At some point later on I probably make an option for global calculated edge colors using a HSL transformation like Allen and Martin suggest / use.
edit:
Playing some more made me change the above to:
Code:
void calcEdgeFromMain() { edgeCol.a=1.0; edgeCol.setIncRGB(mainCol, mainCol.getBrightness()>0.5 ? -0.5 : 0.5); }
Because I like it a bit more, I've also tried Travis' suggestion (scaling by 40% up or down):
Code:
void calcEdgeFromMain() { edgeCol.a=1.0; edgeCol.setScaledRGB(mainCol, mainCol.getBrightness()>0.5 ? 0.6 : 1.4); }
But I found the contrast isn't high enough resulting in disappearing edges under certain angles (caused by shading). The other methods seem less affected by that effect, maybe that's the reason Alan choose 0.4 (although i agree with Travis on it being to red in his example, hence using 0.5).
Using "rgb2hsl -> adjust -> hsl2rgb" will probably be the best solution, but I havn't tried that yet.
note: the called functions limit rgb values to 0.0 .. 1.0)