/
n-dimens
/
pascalabcnet
Обзор
Документация
Войти
/
n-dimens
/
pascalabcnet
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
3.0
TestSamples/CompilationSamples/gradient.pas
37 строк
769 B
Бондарев Иван
initial commit
14 май 2015, 22:35
14 май 2015, 22:35
e6e67c1
Код
Авторство
О чём код?
// ����������� �������. ��������� ������������� �� ������ ������������ �����. uses GraphABC; var i,j: integer; r,g,b:array[0..2] of integer; function LinearInterp(a,b,fa,fb,x: integer): integer; var t: real; begin t:=(x-a)/(b-a); LinearInterp:=round(fa*(1-t)+fb*t); end; begin SetWindowCaption('��������'); SetWindowSize(256*3,400); r[0]:=255; g[0]:=0; b[0]:=255; r[1]:=255; g[1]:=255; b[1]:=0; r[2]:=0; g[2]:=255; b[2]:=255; for i:=0 to 255 do for j:=0 to 2 do begin SetPenColor(RGB(LinearInterp(0,255,r[j],r[(j+1) mod 3],i), LinearInterp(0,255,g[j],g[(j+1) mod 3],i), LinearInterp(0,255,b[j],b[(j+1) mod 3],i))); Line(i+255*j,0,i+255*j,WindowHeight-1); end; end.