mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-08 02:54:56 -06:00
ide: InsertColor improved
git-svn-id: svn://ultimatepp.org/upp/trunk@7403 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
10557d781c
commit
63fef3a786
3 changed files with 17 additions and 2 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue