Class AdjustPalette
Class AdjustPalette
Namespace: Aspose.Imaging.PaletteHelper
Assembly: Aspose.Imaging.dll (25.7.0)
Color palette adjustment class
public class AdjustPalette
{
private readonly IColorAdjustmentService _colorAdjustmentService;
public AdjustPalette(IColorAdjustmentService colorAdjustmentService)
{
_colorAdjustmentService = colorAdjustmentService;
}
public void AdjustColorsInDocument(Document document)
{
foreach (var section in document.Sections)
{
foreach ( var paragraph in section.Paragraphs )
{
foreach (var shape in paragraph.Shapes)
{
if (shape is CheckBox checkBox)
{
AdjustCheckBoxColor(checkBox);
}
}
}
}
}
private void AdjustCheckBoxColor(CheckBox checkBox)
{
var colorAdjustmentResult = _colorAdjustmentService.AdjustColor(checkBox.Fill.ForeColor);
checkBox.Fill.ForeColor = colorAdjustmentResult;
}
}
Inheritance
Inherited Members
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
AdjustPalette()
public AdjustPalette()
{
}
Methods
GetCloseImagePalette(RasterImage, int, ColorQuantizationMethod, ColorCompareMethod)
Gets the close image palette.
public static IColorPalette GetCloseImagePalette(
RasterImage image,
int entriesCount,
ColorQuantizationMethod colorQuantizationMethod,
ColorCompareMethod colorCompareMethod)
{
}
Parameters
image
RasterImage
The image.
entriesCount
int
The entries count.
colorQuantizationMethod
ColorQuantizationMethod
The color quantization method.
colorCompareMethod
ColorCompareMethod
The color compare method.
Returns
Optimized for image palette