Skip to content

Commit 8ca9c3a

Browse files
committed
fixed range check error after editing RGBConv
1 parent 581430b commit 8ca9c3a

File tree

3 files changed

+32
-12
lines changed

3 files changed

+32
-12
lines changed

Main.pas

+4-2
Original file line numberDiff line numberDiff line change
@@ -16573,11 +16573,13 @@ procedure TMainForm.LoadRGBConvNames;
1657316573
Delete (s, 1, 1);
1657416574
Delete (s, Length (s), 1);
1657516575
RGBConvListBox.Items.Add (s);
16576-
if (s = LastSelected) then
16577-
RGBConvListBox.Selected[RGBConvListBox.Items.Count - 1] := TRUE;
1657816576

1657916577
Inc (j);
1658016578
SetLength (RGBConvScripts, j + 1);
16579+
16580+
if (s = LastSelected) then
16581+
RGBConvListBox.ItemIndex := j;
16582+
1658116583
RGBConvScripts[j] := TStringList.Create;
1658216584
end
1658316585
else

RGBConvForm.dfm

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
object RGBConv: TRGBConv
22
Left = 192
33
Top = 107
4-
Width = 450
5-
Height = 429
4+
Width = 545
5+
Height = 497
66
Anchors = [akLeft, akBottom]
77
Caption = 'Color Conversion Scripts'
88
Color = clBtnFace
@@ -17,22 +17,23 @@ object RGBConv: TRGBConv
1717
TextHeight = 13
1818
object lblFilename: TLabel
1919
Left = 8
20-
Top = 376
20+
Top = 428
2121
Width = 39
22-
Height = 13
22+
Height = 18
23+
Anchors = [akLeft, akBottom]
2324
Caption = 'filename'
2425
end
2526
object Script: TMemo
2627
Left = 8
2728
Top = 8
28-
Width = 425
29-
Height = 351
29+
Width = 513
30+
Height = 405
3031
Anchors = [akLeft, akTop, akRight, akBottom]
3132
TabOrder = 0
3233
end
3334
object btnSave: TButton
34-
Left = 248
35-
Top = 368
35+
Left = 335
36+
Top = 424
3637
Width = 89
3738
Height = 25
3839
Anchors = [akRight, akBottom]
@@ -42,8 +43,8 @@ object RGBConv: TRGBConv
4243
OnClick = btnSaveClick
4344
end
4445
object btnCancel: TButton
45-
Left = 344
46-
Top = 368
46+
Left = 431
47+
Top = 424
4748
Width = 89
4849
Height = 25
4950
Anchors = [akRight, akBottom]

rgbconv.txt

+17
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,24 @@ R=255-R
88
G=255-G
99
B=255-B
1010

11+
[Swap Red and Green]
12+
G=R
13+
R=G
14+
1115
[Swap Blue and Green]
1216
G=B
1317
B=G
1418

19+
[Swap Red and Blue]
20+
R=B
21+
B=R
22+
23+
[More Saturation]
24+
R=(12*R-((R+G+B)/3))/11
25+
G=(12*G-((R+G+B)/3))/11
26+
B=(12*B-((R+G+B)/3))/11
27+
28+
[Less Saturation]
29+
R=(11*R+((R+G+B)/2))/12
30+
G=(11*G+((R+G+B)/2))/12
31+
B=(11*B+((R+G+B)/2))/12

0 commit comments

Comments
 (0)