Диаграммы

This commit is contained in:
2026-04-10 02:21:47 +03:00
parent 8580dbc199
commit 72db2c0a47
12 changed files with 252 additions and 12 deletions

View File

@@ -0,0 +1,26 @@
@startuml dz-a1-contrast-activity
title ДЗ.А1 — алгоритм ApplyContrast (по палитре документа)
start
:Вход: **MinintDocument doc**, **double factor**;
:i ← 1;
while (i < doc.Palette.Count?) is (да)
:c <- doc.Palette[i];
:doc.Palette[i] <- новый RgbaColor\n(ContrastByte для R,G,B, c.A);
:i <- i + 1;
endwhile (нет)
:doc.InvalidatePaletteCache();
floating note left
**ContrastByte(x, factor):**
v = ((x/255) - 0.5) * factor + 0.5
return Clamp( round(v * 255), 0, 255 )
--
Индекс палитры 0 не меняется.
end note
stop
@enduml