colori.inc 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {
  2. Free Pascal port of the OpenPTC C++ library.
  3. Copyright (C) 2001-2006 Nikolay Nikolov ([email protected])
  4. Original C++ version by Glenn Fiedler ([email protected])
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. }
  17. Constructor TPTCColor.Create;
  18. Begin
  19. FIndexed := False;
  20. FDirect := False;
  21. FIndex := 0;
  22. FRed := 0;
  23. FGreen := 0;
  24. FBlue := 0;
  25. FAlpha := 1;
  26. End;
  27. Constructor TPTCColor.Create(AIndex : Integer);
  28. Begin
  29. FIndexed := True;
  30. FDirect := False;
  31. FIndex := AIndex;
  32. FRed := 0;
  33. FGreen := 0;
  34. FBlue := 0;
  35. FAlpha := 1;
  36. End;
  37. Constructor TPTCColor.Create(ARed, AGreen, ABlue : Single; AAlpha : Single = 1);
  38. Begin
  39. FIndexed := False;
  40. FDirect := True;
  41. FIndex := 0;
  42. FRed := ARed;
  43. FGreen := AGreen;
  44. FBlue := ABlue;
  45. FAlpha := AAlpha;
  46. End;
  47. Constructor TPTCColor.Create(Const AColor : TPTCColor);
  48. Begin
  49. FIndex := AColor.FIndex;
  50. FRed := AColor.FRed;
  51. FGreen := AColor.FGreen;
  52. FBlue := AColor.FBlue;
  53. FAlpha := AColor.FAlpha;
  54. FDirect := AColor.FDirect;
  55. FIndexed := AColor.FIndexed;
  56. End;
  57. Procedure TPTCColor.Assign(Const AColor : TPTCColor);
  58. Begin
  59. FIndex := AColor.FIndex;
  60. FRed := AColor.FRed;
  61. FGreen := AColor.FGreen;
  62. FBlue := AColor.FBlue;
  63. FAlpha := AColor.FAlpha;
  64. FDirect := AColor.FDirect;
  65. FIndexed := AColor.FIndexed;
  66. End;
  67. Function TPTCColor.Equals(Const AColor : TPTCColor) : Boolean;
  68. Begin
  69. Result := (FIndexed = AColor.FIndexed) And
  70. (FDirect = AColor.FDirect) And
  71. (FIndex = AColor.FIndex) And
  72. (FRed = AColor.FRed) And
  73. (FGreen = AColor.FGreen) And
  74. (FBlue = AColor.FBlue) And
  75. (FAlpha = AColor.FAlpha);
  76. End;