Fix issue 396: increasing Saturation makes greyscale red
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1658 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
dc9df9d1e9
commit
7aefad850d
@ -1366,15 +1366,27 @@ void Button_Palette(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
byte greys=0;
|
||||||
|
byte non_greys=0;
|
||||||
|
// Check if the range contains both greys and non-greys
|
||||||
for (i=block_start; i<=block_end; i++)
|
for (i=block_start; i<=block_end; i++)
|
||||||
|
if (temp_palette[i].R==temp_palette[i].G && temp_palette[i].R == temp_palette[i].B)
|
||||||
|
non_greys=1;
|
||||||
|
else
|
||||||
|
greys=1;
|
||||||
|
|
||||||
|
for (i=block_start; i<=block_end; i++)
|
||||||
|
{
|
||||||
|
byte is_grey = temp_palette[i].R==temp_palette[i].G && temp_palette[i].R == temp_palette[i].B;
|
||||||
Set_HSL(
|
Set_HSL(
|
||||||
temp_palette,
|
temp_palette,
|
||||||
working_palette,
|
working_palette,
|
||||||
i,
|
i,
|
||||||
Color_max-red_slider->Position,
|
is_grey && greys && non_greys ? 0 : Color_max-red_slider->Position,
|
||||||
Color_max-green_slider->Position,
|
is_grey && greys && non_greys ? 0 : Color_max-green_slider->Position,
|
||||||
Color_max-blue_slider->Position
|
Color_max-blue_slider->Position
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (red_slider->Position>Color_max)
|
if (red_slider->Position>Color_max)
|
||||||
@ -1434,15 +1446,27 @@ void Button_Palette(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i=block_start; i<=block_end; i++)
|
byte greys=0;
|
||||||
|
byte non_greys=0;
|
||||||
|
// Check if the range contains both greys and non-greys
|
||||||
|
for (i=block_start; i<=block_end; i++)
|
||||||
|
if (temp_palette[i].R==temp_palette[i].G && temp_palette[i].R == temp_palette[i].B)
|
||||||
|
non_greys=1;
|
||||||
|
else
|
||||||
|
greys=1;
|
||||||
|
|
||||||
|
for (i=block_start; i<=block_end; i++)
|
||||||
|
{
|
||||||
|
byte is_grey = temp_palette[i].R==temp_palette[i].G && temp_palette[i].R == temp_palette[i].B;
|
||||||
Set_HSL(
|
Set_HSL(
|
||||||
temp_palette,
|
temp_palette,
|
||||||
working_palette,
|
working_palette,
|
||||||
i,
|
i,
|
||||||
Color_max-red_slider->Position,
|
is_grey && greys && non_greys ? 0 : Color_max-red_slider->Position,
|
||||||
Color_max-green_slider->Position,
|
is_grey && greys && non_greys ? 0 : Color_max-green_slider->Position,
|
||||||
Color_max-blue_slider->Position
|
Color_max-blue_slider->Position
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (green_slider->Position>Color_max)
|
if (green_slider->Position>Color_max)
|
||||||
@ -1502,15 +1526,27 @@ void Button_Palette(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
byte greys=0;
|
||||||
|
byte non_greys=0;
|
||||||
|
// Check if the range contains both greys and non-greys
|
||||||
for (i=block_start; i<=block_end; i++)
|
for (i=block_start; i<=block_end; i++)
|
||||||
|
if (temp_palette[i].R==temp_palette[i].G && temp_palette[i].R == temp_palette[i].B)
|
||||||
|
non_greys=1;
|
||||||
|
else
|
||||||
|
greys=1;
|
||||||
|
|
||||||
|
for (i=block_start; i<=block_end; i++)
|
||||||
|
{
|
||||||
|
byte is_grey = temp_palette[i].R==temp_palette[i].G && temp_palette[i].R == temp_palette[i].B;
|
||||||
Set_HSL(
|
Set_HSL(
|
||||||
temp_palette,
|
temp_palette,
|
||||||
working_palette,
|
working_palette,
|
||||||
i,
|
i,
|
||||||
Color_max-red_slider->Position,
|
is_grey && greys && non_greys ? 0 : Color_max-red_slider->Position,
|
||||||
Color_max-green_slider->Position,
|
is_grey && greys && non_greys ? 0 : Color_max-green_slider->Position,
|
||||||
Color_max-blue_slider->Position
|
Color_max-blue_slider->Position
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blue_slider->Position>Color_max)
|
if (blue_slider->Position>Color_max)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user