mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 17:29:42 +02:00
fpvectorial: Adds a forgotten file
git-svn-id: trunk@17383 -
This commit is contained in:
parent
bca76120f6
commit
399d072b8f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -2593,6 +2593,7 @@ packages/fpvectorial/src/dxfvectorialreader.pas svneol=native#text/pascal
|
||||
packages/fpvectorial/src/fpvectbuildunit.pas svneol=native#text/pascal
|
||||
packages/fpvectorial/src/fpvectorial.pas svneol=native#text/pascal
|
||||
packages/fpvectorial/src/fpvtocanvas.pas svneol=native#text/pascal
|
||||
packages/fpvectorial/src/fpvutils.pas svneol=native#text/pascal
|
||||
packages/fpvectorial/src/pdfvectorialreader.pas svneol=native#text/pascal
|
||||
packages/fpvectorial/src/pdfvrlexico.pas svneol=native#text/pascal
|
||||
packages/fpvectorial/src/pdfvrsemantico.pas svneol=native#text/pascal
|
||||
|
53
packages/fpvectorial/src/fpvutils.pas
Normal file
53
packages/fpvectorial/src/fpvutils.pas
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
fpvutils.pas
|
||||
|
||||
Vector graphics document
|
||||
|
||||
License: The same modified LGPL as the Free Pascal RTL
|
||||
See the file COPYING.modifiedLGPL for more details
|
||||
|
||||
AUTHORS: Felipe Monteiro de Carvalho
|
||||
Pedro Sol Pegorini L de Lima
|
||||
}
|
||||
unit fpvutils;
|
||||
|
||||
{$ifdef fpc}
|
||||
{$mode delphi}
|
||||
{$endif}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Math,
|
||||
fpvectorial, fpimage;
|
||||
|
||||
// Color Conversion routines
|
||||
function VColorToFPColor(AVColor: TvColor): TFPColor; inline;
|
||||
function VColorToRGBHexString(AVColor: TvColor): string;
|
||||
function RGBToVColor(AR, AG, AB: Byte): TvColor; inline;
|
||||
|
||||
implementation
|
||||
|
||||
function VColorToFPColor(AVColor: TvColor): TFPColor; inline;
|
||||
begin
|
||||
Result.Red := AVColor.Red;
|
||||
Result.Green := AVColor.Green;
|
||||
Result.Blue := AVColor.Blue;
|
||||
Result.Alpha := AVColor.Alpha;
|
||||
end;
|
||||
|
||||
function VColorToRGBHexString(AVColor: TvColor): string;
|
||||
begin
|
||||
Result := Format('%.2x%.2x%.2x', [AVColor.Red, AVColor.Green, AVColor.Blue]);
|
||||
end;
|
||||
|
||||
function RGBToVColor(AR, AG, AB: Byte): TvColor; inline;
|
||||
begin
|
||||
Result.Red := AR;
|
||||
Result.Green := AG;
|
||||
Result.Blue := AB;
|
||||
Result.Alpha := 255;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user