{
Size size = { 0 };
char * string = "";
- ColorDropBox colorDropBox
+ ColorDropBox colorDropBox
{
dataBox, master = master, editText = true, //position = Point { x + 24, y }, /*clientSize.h = */size.h = h, size.w = w - 24,
anchor = { left = 24, top = 0, right = 0, bottom = 0 },
char tempString[MAX_F_STRING];
char * result;
bool needClass = false;
- tempString[0] = 0;
+ tempString[0] = 0;
result = OnGetString(tempString, null, &needClass);
if(result) string = result;
}
}
bool OnGetDataFromString(char * string)
- {
+ {
if(!atoi(string) && (((DefinedColor)this).class::OnGetDataFromString(string) ||
((SystemColor)this).class::OnGetDataFromString(string)))
return true;
surface.Area(x - 4, y, x + 20, y + 15);
surface.SetBackground(this);
- surface.Area(x, y + 2, x+17, y+13);
+ surface.Area(x, y + 2, x+17, y+13);
surface.SetForeground(black);
surface.Rectangle(x-1, y + 1, x + 18, y + 14);
}
float minV, maxV, diff,dr,dg,db;
float h, s, v;
-
+
minV = Min(r, g);
minV = Min(minV, b);
db = (maxV - b)/diff;
/*
- if R=V then -- between yellow and magenta [degrees]
- H=60.0*(G-B)/Delta
- else if G=V then -- between cyan and yellow
- H=120.0+60.0*(B-R)/Delta
- else -- between magenta and cyan
- H=240.0+60.0*(R-G)/Delta
+ if R=V then -- between yellow and magenta [degrees]
+ H=60.0*(G-B)/Delta
+ else if G=V then -- between cyan and yellow
+ H=120.0+60.0*(B-R)/Delta
+ else -- between magenta and cyan
+ H=240.0+60.0*(R-G)/Delta
*/
- if(r == maxV)
+ if(r == maxV)
h = db - dg;
else if(g == maxV)
h = 2 + dr - db;
float q = v*(1-(s*f));
float t = v*(1-s*(1-f));
float r,g,b;
- switch(i)
+ switch(i)
{
case 0: r = v; g = t; b = p; break;
case 1: r = q; g = v; b = p; break;
float x = r * 0.412453f + g * 0.357580f + b * 0.180423f;
float y = r * 0.212671f + g * 0.715160f + b * 0.072169f;
float z = r * 0.019334f + g * 0.119193f + b * 0.950227f;
-
+
x /= 0.950456f;
y /= 1;
z /= 1.088754f;
float x,y,z,r,g,b, P;
P = (l + 16)/116;
-
+
if(l > 903.3f * 0.008856f)
{
y = (l + 16) / 116;
x = a / 500 + P;
- if(x > 0.206893f)
+ if(x > 0.206893f)
x = x*x*x;
else
x = (116 * x - 16) / 903.3f;
z = P - this.b / 200;
- if(z > 0.206893f)
+ if(z > 0.206893f)
z = z*z*z;
else
z = (116 * z - 16) / 903.3f;
-
+
x *= 0.950456f;
y *= 1;
{
// surface.WriteTextDots(alignment, x + 24, y + 1, width - 24, string, strlen(string));
surface.SetBackground(this);
- surface.Area(x, y + 4, x+19, y+11);
+ surface.Area(x, y + 4, x+19, y+11);
surface.SetForeground(black);
surface.Rectangle(x-1, y + 3, x + 20, y + 12);
Window pullDown
{
- master = this, interim = true, autoCreate = false, minSize = { 204, 222 },
+ master = this, interim = true, autoCreate = false, minSize = { 204, 222 },
background = formColor, borderStyle = contour|bevel;
bool OnKeyDown(Key key, unichar ch)
position = Point { 136, 0 },
isRadio = true,
bevelOver = true,
- inactive = true,
+ inactive = true,
bitmap = null;
bool NotifyClicked(Button button, int x, int y, Modifiers mods)