summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lowlevelunit.pas21
1 files changed, 21 insertions, 0 deletions
diff --git a/lowlevelunit.pas b/lowlevelunit.pas
index 1d3aa33..ab0a2fa 100644
--- a/lowlevelunit.pas
+++ b/lowlevelunit.pas
@@ -59,12 +59,14 @@ function binOpPos(op: char; s: string): integer;
function fktPos(fkt,s: string): integer;
procedure gibAus(s: string; ausgaben: byte);
function strToGen(out gen: tGenauigkeit; s: string): boolean;
+function mischeFarben(a,b: tRGB; x: extended): tRGB;
function orFarben(a,b: tRGB): tRGB;
function andFarben(a,b: tRGB): tRGB;
function wertZuFarbe(x: extended; p: tRGBArray): tRGB;
function tFPColor2tRgb(c: tFPColor): tRGB;
function tRgb2tFPColor(c: tRGB): tFPColor;
function rgb(r,g,b: byte): tRGB; inline;
+function strToTRGB(s: string; out rgb: tRGB): boolean;
procedure myDebugLnThreadLog(s: string);
procedure cleanupLogs;
procedure cleanupLog(tid: PtrUInt);
@@ -498,6 +500,25 @@ begin
result.rgbBlue:=b;
end;
+function strToTRGB(s: string; out rgb: tRGB): boolean;
+var
+ i: longint;
+begin
+ result:=false;
+ if length(s)=6 then begin
+ result:=true;
+ for i:=1 to 6 do
+ result:=result and (s[i] in ['0'..'9','a'..'f','A'..'F']);
+ if result then begin
+ i:=strToInt('$'+s);
+ rgb.rgbRed:= (i and $ff0000) shr 16;
+ rgb.rgbGreen:=(i and $00ff00) shr 8;
+ rgb.rgbBlue:= i and $0000ff;
+ exit;
+ end;
+ end;
+end;
+
procedure myDebugLnThreadLog(s: string);
var
f: textfile;