unit UColorByID;

interface

procedure RedbyID(const ID:Cardinal; Out Red:Byte); overload;
procedure RedbyID(const ID:Cardinal; Out Red:Real); overload;
procedure GreenbyID(const ID:Cardinal; Out Red:Byte); overload;
procedure GreenbyID(const ID:Cardinal; Out Red:Real); overload;
procedure BluebyID(const ID:Cardinal; Out Red:Byte); overload;
procedure BluebyID(const ID:Cardinal; Out Red:Real); overload;

implementation

uses Math;            
    
procedure RedbyID(const ID:Cardinal; Out Red:Byte); overload;
begin
  Red:=Round(power((ID+1)*123,3)+(ID+1)*1234567) mod 255;
end;

procedure RedbyID(const ID:Cardinal; Out Red:Real); overload;
begin
  Red:=(Round(power((ID+1)*123,3)+(ID+1)*1234567) mod 255)/255;
end;

procedure GreenbyID(const ID:Cardinal; Out Red:Byte); overload;
begin
  Red:=Round(power((ID+1)*1234,3)+(ID+1)*123456) mod 255;
end;

procedure GreenbyID(const ID:Cardinal; Out Red:Real); overload;
begin
  Red:=(Round(power((ID+1)*1234,3)+(ID+1)*123456) mod 255)/255;
end;

procedure BluebyID(const ID:Cardinal; Out Red:Byte); overload;
begin
  Red:=Round(power((ID+1)*12356,3)+(ID+1)*12345) mod 255;
end;

procedure BluebyID(const ID:Cardinal; Out Red:Real); overload;
begin
  Red:=(Round(power((ID+1)*12356,3)+(ID+1)*12345) mod 255)/255;
end;

end.
