Closed Phillipus closed 8 months ago
For (2) we propose to lose the user configurable "Contrast factor" setting and hard code it into the app.
And to convert the "Derive element line colours from fill colours" to a default setting. Then set it on or off for each figure.
The code for calculating the derived line colour should also be changed to account for dark fill colours.
For (3) we need to take an inventory of all element figures and summarise what fill colours, line colours, and line thicknesses are required for drawing the figure.
For example, the Plateau
figure should use the fill colour instead of the line colour. Or the Goal figure should only use 1 pixel line thickness to draw the inner rings of the circle.
@jbsarrodie Regarding (2) the current default application setting for "Derive element line colours from fill colours" is true. Should the default also be true per figure?
We need two defaults:
@jbsarrodie I created a new method to derive the line color:
public static Color getDerivedLineColor(Color color) {
if(color == null) {
return null;
}
float contrastFactor = 0.7f;
RGB rgb = new RGB((int)(color.getRed() * contrastFactor), (int)(color.getGreen() * contrastFactor), (int)(color.getBlue() * contrastFactor));
return get(convertRGBToString(rgb));
}
This is the same code as we used before (getDarkerColor
) but, as you mentioned, this should now take into account darker colors and perhaps show a lighter color...can you suggest an algorithm?
This is the same code as we used before (
getDarkerColor
) but, as you mentioned, this should now take into account darker colors and perhaps show a lighter color...can you suggest an algorithm?
I have an implementation locally (which means I've successfully setup my eclipse and git environment), but I have an issue with pushing my work (most certainly due to corporate proxy). I can share the modified source code for ColorFactory
in this issue if you want.
but I have an issue with pushing my work
Could it be because I have force pushed the dev
branch and you need to pull it again?
I can share the modified source code for ColorFactory in this issue if you want.
OK
Could it be because I have force pushed the
dev
branch and you need to pull it again?
No, it doesn't even work on a brand new, empty, repository. It seems my corporate proxy (or other network security appliance) is rejecting POST request from git (but it does work from my browser).
Here is the proposed code (which does include a variant for getLighterColor()
(current version clips some colors components, mine don't): ColorFactory.txt
Btw, after some experimentation, I finally think lightening the border color for dark fill color is not really a good option. Most of the time the figures are drawn on a white background and there is not enough contrast to see the border color anymore.
But drawing top right icon using a light (or white) color when fill color become too dark does improve things.
Here is the proposed code (which does include a variant for getLighterColor()(current version clips some colors components, mine don't): ColorFactory.txt
OK, that seems to work. Do you want to go with that? I can commit if required.
(dev
branch rebased and force pushed)
@jbsarrodie Regarding (2) the current default application setting for "Derive element line colours from fill colours" is true. Should the default also be true per figure?
We need two defaults:
1. The overall application default for the setting of newly created objects 2. The default for loading objects (if the feature is not set in the model file, should it default to true or false?)
I'm thinking now that the defaults should be set to false
This is in Archi 5.2.
This is an overall issue to track the following proposed changes:
The first part of (1) is committed in the
dev
branch. This allows setting line thickness of 1, 2, or 3 pixels named "Normal", "Medium" and "Heavy" to align with the names of the line thickness settings of a connection.