Josh, thanks for the updates. Apologies for disappearing yesterday, as I was feeling a bit off (badly sore ear).
I looked at your two circle fractal updates and experimented. Tried changing the divisor slightly from R /4.2 to R/3.8. Some nice patterns happening. I also did a shape insertion in the middle of the circle fractal with a paint program, just to see the effect.
Looking good. I especially like the color scheme generated circle fractal with R/3.8, with the bright smaller upper level petals.
Your random colour mode with opacity now has a "jeweled like effect".
Need to understand how you did that opacity with bgrabmp so will need to go over that:
if FillBackGround then bmp.EllipseAntialias(X, Y,R+RAdjust, R+RAdjust,ColorToBGRA(PenColor,tb_Opacity.Position),PenWidth,ColorToBGRA(BrushColor,tb_Opacity.Position))
else bmp.EllipseAntialias(X, Y,R+RAdjust, R+RAdjust,ColorToBGRA(PenColor,tb_Opacity.Position),PenWidth);
Dzandaa used PictOrig := TBGRABitmap.Create(w, h, BGRAPixelTransparent); and PictOrig.FillPoly(Pt, Col, dmDrawWithTransparency, True); to do the fills. Wondering what the difference is?
Also with the Pythagoras Tree here (
https://forum.lazarus.freepascal.org/index.php/topic,66256.0.html) I used Luminance to filter out some of the colours (to make either dark or light random colours)
function GetLuminance(color: TColor): Double;
var
r, g, b: Byte;
begin
r := Red(color);
g := Green(color);
b := Blue(color);
Result := 0.2126 * r / 255 + 0.7152 * g / 255 + 0.0722 * b / 255;
end;
procedure TForm1.GenerateRandomColors;
var
i: Integer;
begin
SetLength(Colors, 20);
for i := 0 to High(Colors) do
begin
repeat
Colors[i] := RGBToColor(Random(256), Random(256), Random(256));
until GetLuminance(Colors[i]) > LumLimit;
end;
end;
and also transitioning from one colour to another:
procedure TForm1.GenerateColorsBrowntoGreen;
var
i: Integer;
BrownR, BrownG, BrownB: Byte;
GreenR, GreenG, GreenB: Byte;
BlendFactorFill, BlendFactorLine: Double;
MaxLevel: Integer;
begin
BrownR := 101;
BrownG := 67;
BrownB := 33;
GreenR := 0;
GreenG := 128;
GreenB := 0;
MaxLevel := seRecursionLevel.Value;
SetLength(Colors, MaxLevel);
for i := 0 to MaxLevel - 1 do
begin
BlendFactorFill := i / (MaxLevel - 1);
Colors[i] := RGBToColor(
Round((1 - BlendFactorFill) * BrownR + BlendFactorFill * GreenR),
Round((1 - BlendFactorFill) * BrownG + BlendFactorFill * GreenG),
Round((1 - BlendFactorFill) * BrownB + BlendFactorFill * GreenB)
);
BlendFactorLine := i / (MaxLevel - 1);
Colors[i] := RGBToColor(
Round((1 - BlendFactorLine) * BrownR + BlendFactorLine * GreenR),
Round((1 - BlendFactorLine) * BrownG + BlendFactorLine * GreenG),
Round((1 - BlendFactorLine) * BrownB + BlendFactorLine * GreenB)
);
end;
end;
Josh, Thanks for helping to add those great features and demonstrating how to use bgrabmp.
I am still learning bgrabmp so your samples are really good for learning purposes.
I always like looking at your work and how you do things (don't always fully understand it but progressively getting better), as well as Dzandaa's nice samples.