ide: InsertColor improved

git-svn-id: svn://ultimatepp.org/upp/trunk@7403 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-05-29 09:32:22 +00:00
parent 10557d781c
commit 63fef3a786
3 changed files with 17 additions and 2 deletions

View file

@ -76,6 +76,9 @@ public:
void Set(RGBA c);
void MaskSet(int a);
RGBA Get() const;
Color GetColor() const;
int GetAlpha() const;
void Mask(bool b);

View file

@ -156,6 +156,16 @@ RGBA RGBACtrl::Get() const
return c;
}
Color RGBACtrl::GetColor() const
{
return color;
}
int RGBACtrl::GetAlpha() const
{
return alpha.Get();
}
void RGBACtrl::Mask(bool b)
{
alpha.Mask(b);

View file

@ -25,10 +25,12 @@ void InsertColorDlg::Select(int i)
void InsertColorDlg::Sync()
{
RGBA c0 = rgbactrl.GetColor();
RGBA c = rgbactrl.Get();
r[0] = Format("RGBA(%d, %d, %d, %d)", c.a, c.r, c.g, c.b);
r[0] = Format("%d, %d, %d, %d", c.a, c.r, c.g, c.b);
rgba.SetLabel(r[0]);
r[1] = Format("Color(%d, %d, %d)", c.r, c.g, c.b);
r[1] = c.a == 255 ? Format("Color(%d, %d, %d)", c.r, c.g, c.b)
: Format("%d * Color(%d, %d, %d)", c.a, c0.r, c0.g, c0.b);
color.SetLabel(r[1]);
r[2] = Format("%02x%02x%02x%02x", c.a, c.r, c.g, c.b);
ahex.SetLabel(r[2]);