Make the center control point of shapes visible on dark backgrounds
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi,
the newly added center control points of shapes currently have a fixed
stroke color of 0x010000000, the main problem with this is that the
control points become invisible on black backgrounds.
The fill and stroke colors for shape control points are hardcoded in
SPKnot::SPKnot(), and for the other control points the default values
work fine, for the NORMAL status they are:
fill_color = 0xffffff00
stroke_color = 0x01000000
That is white fill with a basically black stroke.
AFAICS when the alpha channel is 0 Inkscape does not apply the XOR
operator but uses the color as is (see
src/display/
from above still works fine on every background even without the XOR
compositing because of the heavy contrast between the stroke and the
fill color.
The problem with the center control points is that they are only drawn
with the stroke color, so XOR blending is actually needed for them.
An hackish solution would be to call SPKnot::setStroke() for any
entity_center->knot objects, like in the attached patch.
However this is not very elegant IMHO.
A better alternative would be to be able to pass a _set_ of colors for
the different states to KnotHolderEntit
accepts a fill_color, but that would need some refactoring and I'd like
advice from developers more familiar with the Inkscape codebase than
I am.
Inkscape has different ways of specifying the control points color
depending on the state (normal, mouseover, dragging, selected).
guint32 arrays in src/seltrans-
guint32 const DEF_COLOR[] = { 0xff, 0xff6600, 0xff6600, 0xff, 0xff, 0xff };
guint32 const CEN_COLOR[] = { 0x0, 0x0, 0x0, 0xff, 0xff0000b0, 0xff0000b0 };
Scalar values assigned individually like
SPKnot:
void SPKnot:
fill[
fill[
fill[
fill[
}
And partial assignments, like in KnotHolderEntit
src/knot-
knot->fill [SP_KNOT_
g_object_set (G_OBJECT(
There is also a very handy structured data approach like
ControlPoint:
ControlPoint:
{0xbfbfbf00, 0x000000ff}, // normal fill, stroke
{0xff000000, 0x000000ff}, // mouseover fill, stroke
{0xff000000, 0x000000ff}, // clicked fill, stroke
//
{0x0000ffff, 0x000000ff}, // normal fill, stroke when selected
{0xff000000, 0x000000ff}, // mouseover fill, stroke when selected
{0xff000000, 0x000000ff} // clicked fill, stroke when selected
};
Ideally I would like to be able to pass a ColorSet to
KnotHolderEntit
SPKnot::setStoke().
Any advice about what the best place to move the ColorSet definition
would be?
BTW what is the relationship between ControlPoint and SPKnot?
Thanks,
Antonio
Updated the attachment, the old one contained an unrelated change.