Created
November 12, 2021 21:24
-
-
Save olekstomek/af9e8d72a101b8bf4a262e4de4c9618d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program ColorPicker; | |
uses crt; | |
const | |
QuitKey = #27; | |
PrevKey = #75; | |
NextKey = #77; | |
var | |
Picked : byte; | |
Quit : boolean; | |
FuncKey : char; | |
I : shortint; | |
begin | |
Quit:=false; | |
Picked:=0; | |
repeat | |
clrscr; | |
textcolor(Picked); | |
for I:=1 to 8 do | |
write(#219); | |
textcolor(7); | |
writeln('=',Picked); | |
writeln(' Arrows and numbers to pick, ESC to quit.'); | |
writeln(' Programmed by Jan "Manna5" Mleczko.'); | |
FuncKey:=readkey; | |
if FuncKey=QuitKey then | |
Quit:=true | |
else | |
if (FuncKey >= '0') and (FuncKey <= '9') then | |
Picked:=ord(FuncKey)-48 | |
else if (FuncKey >= 'a') and (FuncKey <= 'f') then | |
Picked:=ord(FuncKey)-87 | |
else | |
if FuncKey=#0 then | |
begin | |
FuncKey:=readkey; | |
case FuncKey of | |
NextKey : if Picked < 15 then | |
inc(Picked); | |
PrevKey : if Picked > 0 then | |
dec(Picked); | |
end; | |
end; | |
until Quit; | |
clrscr; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Autor: Manna5
https://4programmers.net/Mikroblogi/View/113780
Narzędzie to wyboru kolorów (color picker)
Aplikacja napisana w Pascalu. Można przeglądać dostępne kolory za pomocą strzałek i cyfr (szesnastkowych), wyświetlany jest pasek w danym kolorze o szerokości ośmiu znaków oraz kod koloru tym razem w systemie dziesiętnym. Kod ma tylko 49 linii i jest umieszczony poniżej.