mbColorLib: Less hints and warnings.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8129 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2021-10-27 17:26:55 +00:00
parent 83b7ffa66d
commit abdec8801e
19 changed files with 61 additions and 45 deletions

View File

@ -17,8 +17,6 @@ type
FShowSatCirc: boolean;
FShowHueLine: boolean;
FShowSelCirc: boolean;
procedure SetRelHue(H: Double);
procedure SetRelSat(S: Double);
procedure SetSatCircColor(c: TColor);
procedure SetHueLineColor(c: TColor);
procedure DrawSatCirc;
@ -35,6 +33,8 @@ type
procedure Paint; override;
procedure Resize; override;
procedure SelectColor(x, y: integer); override;
procedure SetRelHue(H: Double); override;
procedure SetRelSat(S: Double); override;
procedure SetSelectedColor(c: TColor); override;
public
constructor Create(AOwner: TComponent); override;

View File

@ -53,7 +53,7 @@ type
implementation
uses
Math, mbUtils, PalUtils;
Math, mbUtils;
{ THSColorPicker }

View File

@ -314,8 +314,6 @@ begin
end;
procedure THSLColorPicker.HSPickerChange(Sender: TObject);
var
c: TColor;
begin
FLVPicker.Lock; // Lock the LVPicker to generate OnChange events here.
try

View File

@ -18,7 +18,7 @@ type
FSLPicker: TSLColorPicker;
FSelectedColor: TColor;
// FRValue, FGValue, FBValue: integer;
FRingHint, FSLHint: string;
FRingHint: string;
FSLMenu, FRingMenu: TPopupMenu;
FSLCursor, FRingCursor: TCursor;
PBack: TBitmap;
@ -33,7 +33,7 @@ type
function GetRed: Integer;
function GetGreen: Integer;
function GetBlue: Integer;
function GetLVHint(AMode: TBrightnessMode): String;
function GetLVHint({%H-}AMode: TBrightnessMode): String;
procedure SetBrightnessMode(AMode: TBrightnessMode);
procedure SetHue(H: integer);
procedure SetSat(S: integer);

View File

@ -1,5 +1,8 @@
unit HTMLColors;
{$IF FPC_FullVersion >= 30200}
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
{$IFEND}
interface
uses

View File

@ -9,7 +9,7 @@ interface
//{$I mxs.inc}
uses
LCLIntf, LCLType, LMessages, SysUtils, Classes, Controls, Graphics, StdCtrls,
LCLIntf, LCLType, LMessages, SysUtils, Classes, Controls, Graphics,
Forms, Themes, Math,
HTMLColors, mbBasicPicker;

View File

@ -22,7 +22,7 @@ type
function LumFromArrowPos(p: integer): Double;
function ValFromArrowPos(p: Integer): Double;
function GetHint(AMode: TBrightnessMode): String;
procedure SetHint(AMode: TBrightnessMode; AText: String);
procedure SetHint(AMode: TBrightnessMode; AText: String); reintroduce;
protected
procedure Execute(tbaAction: integer); override;
function GetArrowPos: integer; override;

View File

@ -65,7 +65,7 @@ function ReadPhotoshopAct(PalFile: TFileName): string;
implementation
uses
Math, mbColorConv;
mbColorConv;
function ReplaceFlags(s: string; flags: array of string; value: integer): string;
var
@ -239,7 +239,7 @@ var
Scolor: string;
Faktor: double;
a: RGBArray;
b: array of RGBArray;
b: array of RGBArray = nil;
begin
Result := '';
Span := 300;
@ -683,13 +683,22 @@ end;
function ReadPhotoshopAco(PalFile: TFileName): AcoColors;
var
f: file;
ver, num, space, w, x, y, z, dummy: Word;
i: integer;
v0Length: byte;
v0Name: string;
v2Length: Word;
v2Name: WideString;
ver: word = 0;
num: word = 0;
space: word = 0;
w: word = 0;
x: word = 0;
y: word = 0;
z: word = 0;
dummy: Word = 0;
v0Length: byte = 0;
v0Name: string = '';
v2Length: Word = 0;
v2Name: WideString = '';
begin
Result := Default(AcoColors);
if not FileExists(PalFile) then
begin
SetLength(Result.Colors, 0);
@ -744,7 +753,7 @@ begin
SetLength(v0Name, v0Length);
if v0Length > 0 then
BlockRead(f, PChar(v0Name)^, v0Length);
Result.Names[i] := v0Name;
Result.Names[i] := UTF8Decode(v0Name);
end;
2: begin
BlockRead(f, dummy, sizeof(dummy));
@ -753,7 +762,7 @@ begin
SetLength(v2Name, v2Length - 1);
if v2Length > 0 then
begin
BlockRead(f, PWideChar(v2Name)^, 2*(v2Length - 1));
BlockRead(f, PWideChar(v2Name)^, (Int64(v2Length) - 1)*2);
ExchangeChars(v2Name);
end;
Result.Names[i] := v2Name;
@ -767,7 +776,9 @@ end;
function ReadPhotoshopAct(PalFile: TFileName): string;
var
f: file;
r, g, b: byte;
r: byte = 0;
g: byte = 0;
b: byte = 0;
s: TStringList;
i: integer;
begin

View File

@ -1,5 +1,7 @@
unit RGBCMYKUtils;
{$IF FPC_Fullversion >= 30200}
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
{$IFEND}
interface
// Activate only one of these defines - see comments below

View File

@ -4,6 +4,10 @@ unit RGBHSVUtils;
{$MODE DELPHI}
{$ENDIF}
{$IF FPC_FullVersion >= 30200}
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
{$IFEND}
interface
uses

View File

@ -13,7 +13,7 @@ type
private
FHint: array[TBrightnessMode] of string;
function GetHint(AMode: TBrightnessMode): String;
procedure SetHint(AMode: TBrightnessMode; AText: String);
procedure SetHint(AMode: TBrightnessMode; AText: String); reintroduce;
protected
procedure CorrectCoords(var x, y: integer);
procedure CreateWnd; override;

View File

@ -8,7 +8,7 @@ interface
uses
LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms,
ExtCtrls, StdCtrls,
ExtCtrls,
PalUtils;
const

View File

@ -60,6 +60,9 @@
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -9,7 +9,7 @@ object Form1: TForm1
Font.Color = clWindowText
OnCreate = FormCreate
ShowHint = True
LCLVersion = '2.2.0.1'
LCLVersion = '2.3.0.0'
object PageControl1: TPageControl
Left = 6
Height = 404
@ -52,7 +52,7 @@ object Form1: TForm1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = CbMarker
AnchorSideTop.Side = asrCenter
Left = 111
Left = 109
Height = 15
Top = 355
Width = 40
@ -82,7 +82,7 @@ object Form1: TForm1
Left = 4
Height = 19
Top = 353
Width = 83
Width = 81
BorderSpacing.Left = 4
Caption = 'SliderVisible'
Checked = True
@ -93,7 +93,7 @@ object Form1: TForm1
object CbMarker: TComboBox
AnchorSideLeft.Control = Label4
AnchorSideLeft.Side = asrBottom
Left = 159
Left = 157
Height = 23
Top = 351
Width = 103
@ -115,10 +115,10 @@ object Form1: TForm1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = CbMarker
AnchorSideTop.Side = asrCenter
Left = 286
Left = 284
Height = 20
Top = 352
Width = 101
Width = 99
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Left = 24
Caption = 'NewArrowStyle'
@ -1398,7 +1398,7 @@ object Form1: TForm1
Left = 0
Height = 19
Top = 210
Width = 83
Width = 81
BorderSpacing.Top = 4
Caption = 'SwatchStyle'
OnClick = CbSwatchStyleClick
@ -1423,7 +1423,7 @@ object Form1: TForm1
Left = 0
Height = 19
Top = 328
Width = 66
Width = 64
BorderSpacing.Top = 12
Caption = 'WebSafe'
OnClick = CbWebSsafeClick
@ -1436,7 +1436,7 @@ object Form1: TForm1
Left = 0
Height = 19
Top = 351
Width = 78
Width = 76
BorderSpacing.Top = 4
Caption = 'Show hints'
Checked = True
@ -1451,7 +1451,7 @@ object Form1: TForm1
Left = 0
Height = 19
Top = 374
Width = 62
Width = 60
BorderSpacing.Top = 4
Caption = 'Enabled'
Checked = True

View File

@ -1,5 +1,5 @@
unit main;
{$WARN 5024 off : Parameter "$1" not used}
interface

View File

@ -6,8 +6,8 @@ interface
uses
SysUtils, LCLIntf, LCLType, Classes, Controls, StdCtrls,
Graphics, GraphUtil, Forms, Themes,
HTMLColors, RGBHSLUtils, RGBHSVUtils, RGBCMYKUtils, RGBCIEUtils, PalUtils;
Graphics, Forms, Themes,
HTMLColors, {RGBHSLUtils, RGBHSVUtils, RGBCMYKUtils, RGBCIEUtils,} PalUtils;
type
TmbColor = record

View File

@ -692,7 +692,7 @@ begin
FNames.Clear;
if a.HasNames then
for i := 0 to Length(a.Names) - 1 do
FNames.Add(a.Names[i]);
FNames.Add(UTF8Encode(a.Names[i]));
end
else if SameText(ExtractFileExt(FileName), '.act') then
begin

View File

@ -907,18 +907,9 @@ end;
procedure TmbHSLVTrackbarPicker.SetBrightnessMode(AMode: TBrightnessMode);
var
c: TColor;
S, L, V: Double;
begin
c := HSLVtoColor(FHue, FSat, FLum, FVal);
FBrightnessMode := AMode;
(*
ColorToHSLV(c, FHue, S, L, V);
SetRelSat(S);
case AMode of
bmLuminance: SetRelLum(L);
bmValue : SetRelVal(V);
end;
*)
ColorToHSLV(c, FHue, FSat, FLum, FVal);
CreateGradient;
Invalidate;

View File

@ -2,6 +2,10 @@ unit mbColorConv;
{$mode objfpc}{$H+}
{$IF FPC_FullVersion >= 30200}
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
{$IFEND}
interface
uses