1
0
mirror of synced 2024-11-30 18:24:39 +01:00

Make alpha seperate from colors in the hue selector for ptcl

This commit is contained in:
KillzXGaming 2019-08-20 19:56:47 -04:00
parent 1815168479
commit 4a137d34cc
5 changed files with 16 additions and 8 deletions

Binary file not shown.

View File

@ -108,17 +108,20 @@ namespace FirstPlugin
ActivePanel = panel;
if (ActivePanel.IsAlpha)
{
int alpha = panel.GetColor().R;
colorSelector1.DisplayColor = false;
colorSelector1.DisplayAlpha = true;
colorSelector1.Alpha = panel.GetColor().R;
colorSelector1.Alpha = alpha;
UpdateColorSelector(Color.FromArgb(alpha, alpha, alpha));
}
else
{
colorSelector1.DisplayColor = true;
colorSelector1.DisplayAlpha = false;
UpdateColorSelector(panel.GetColor());
}
UpdateColorSelector(panel.GetColor());
if (panel is Color8KeySlider)
UpdateTimeDisplay(((Color8KeySlider)panel).GetTime());

View File

@ -30,10 +30,7 @@ namespace Toolbox.Library.Forms
{
get
{
if (DisplayColor)
return _color;
else
return Color.FromArgb(Alpha, Alpha, Alpha);
return _color;
}
set
{
@ -61,7 +58,7 @@ namespace Toolbox.Library.Forms
set
{
displayAlpha = value;
alphaPanel.Enabled = displayAlpha;
alphaPanel.Visible = displayAlpha;
}
}
@ -370,6 +367,9 @@ namespace Toolbox.Library.Forms
alphaY = y;
Alpha = (byte)(255 - ((float)y / (alphaPanel.Height - 1) * 255));
if (!huePanel.Enabled)
_color = Color.FromArgb(Alpha, Alpha, Alpha);
if (ColorChanged != null)
ColorChanged(this, null);
}
@ -415,7 +415,7 @@ namespace Toolbox.Library.Forms
{
int x = Math.Min(Math.Max(e.X, 0), colorSquare.Width);
int y = Math.Min(Math.Max(e.Y, 0), colorSquare.Height);
if (!DisplayColor)
if (!huePanel.Enabled)
y = colorSquare.Height;
if ((x != _squareX) || (y != _squareY))
@ -424,6 +424,11 @@ namespace Toolbox.Library.Forms
_hsv.S = (byte)((float)(colorSquare.Height - y) / colorSquare.Height * 100);
OnColorChanged(true);
if (!huePanel.Enabled) {
Alpha = _color.R;
alphaPanel.Invalidate();
}
}
}
}