Skip to content

Z07 Triangle

Gustav Schubert edited this page Jan 25, 2021 · 3 revisions

It should not come as a surprise that I am using triangles as an example more than once.

screenshot of drawing Z07

Try and improve the colors for the dark mode.

Note that I have used TRggColor as the type for the colors. This is mainly because there will be multiple implementations of the documentation drawing code, for different platforms like FMX, VCL and LCL. The colors used to draw to the canvas of the platform are different. I wanted or needed to abstract the sample code from the actual colors used, so that I do not get unnecessary noise when comparing examples.

I need to compare the same examples between platforms. They are not actually the same, but should be comparable, so that I can merge any improvements between them.

I am using a good diff tool to do the diff.

procedure TRggDrawingZ07.GoDark;
begin
  inherited;
  A.StrokeColor := TRggColors.Tomato;
  BC.StrokeColor := TRggColors.Tomato;

  B.StrokeColor := TRggColors.Dodgerblue;
  AC.StrokeColor := TRggColors.Dodgerblue;

  C.StrokeColor := TRggColors.Lime;
  AB.StrokeColor := TRggColors.Lime;

  T.StrokeColor := TRggColors.Gray;
end;

You should be able to use intellisense in the source code editor to select a color.

Home work

  • Be an artist and improve the colors.
  • Show and hide the captions of individual elements.
  • Force all captions elements to be shown, even the hidden ones.

You can hide and show captions at runtime. The initial value, whether a caption is initially hidden or visible, can be specified in code.

Clone this wiki locally