Nice! Beautiful color themes
I would suggest a little change to avoid invalidating twice:
procedure TFXGraphicControl.FXInvalidate;
begin
if (csDesigning in ComponentState) then
Invalidate else
begin
if Parent is TFXContainer then
begin
if TFXContainer(Parent).ReceivePaintFrom = nil then
Parent.Invalidate;
end
else
Invalidate;
end;
end;
Also to make FXDraw virtual so that it would be possible to add some OpenGL extra rendering:
procedure FXDraw; virtual;
What I would also suggest is to use OpenGL ability to colorize. When doing BGLCanvas.PutImage, you can specify a color that will multiply the image. So in principle what you can do is to prepare a shape of a button in white, and then when the color changes, to draw it in the specified color without having to redraw the shape.
One need to take into account that the text may have another color, or that it would still need to be white and not colorised. So a way to do that would be to have layers instead of only one FBGRA. Basically you need a list of records with FBGRA, FTexture and FColor for each of the layers.