OfficeColorSpaceConverter
OfficeIMO.Drawing
Dependency-free conversion from common device and calibrated color spaces to sRGB.
Inheritance
- object
- OfficeColorSpaceConverter
Methods
public static OfficeColor FromCalibratedGray(double gray, double whiteX, double whiteY, double whiteZ, double gamma = 1) #Converts a calibrated gray component and gamma using an explicit XYZ white point.
Parameters
- gray double
- whiteX double
- whiteY double
- whiteZ double
- gamma double = 1
Returns
OfficeColorpublic static OfficeColor FromCalibratedRgb(double red, double green, double blue, double whiteX, double whiteY, double whiteZ, IReadOnlyList<double>? gamma = null, IReadOnlyList<double>? matrix = null) #Converts calibrated RGB through per-channel gamma and a nine-value column-major XYZ matrix. Missing gamma and matrix values use PDF-compatible identity defaults.
Parameters
- red double
- green double
- blue double
- whiteX double
- whiteY double
- whiteZ double
- gamma System.Collections.Generic.IReadOnlyList<double>? = null
- matrix System.Collections.Generic.IReadOnlyList<double>? = null
Returns
OfficeColorpublic static OfficeColor FromCmyk(double cyan, double magenta, double yellow, double black) #Converts normalized subtractive device components to sRGB.
Parameters
- cyan double
- magenta double
- yellow double
- black double
Returns
OfficeColorpublic static OfficeColor FromLab(double lightness, double a, double b) #Converts CIE L*a*b* using the D50 reference white to sRGB.
Parameters
- lightness double
- a double
- b double
Returns
OfficeColorpublic static OfficeColor FromLab(double lightness, double a, double b, double whiteX, double whiteY, double whiteZ) #Converts CIE L*a*b* using an explicit XYZ reference white to sRGB.
Parameters
- lightness double
- a double
- b double
- whiteX double
- whiteY double
- whiteZ double
Returns
OfficeColorpublic static OfficeColor FromLinearSrgb(double red, double green, double blue) #Converts linear-light sRGB components to encoded sRGB.
Parameters
- red double
- green double
- blue double
Returns
OfficeColorpublic static OfficeColor FromOklab(double lightness, double a, double b) #Converts OKLab coordinates to encoded sRGB.
Parameters
- lightness double
- a double
- b double
Returns
OfficeColorpublic static OfficeColor FromXyz(double x, double y, double z, double sourceWhiteX = 0.95047, double sourceWhiteY = 1, double sourceWhiteZ = 1.08883) #Converts XYZ values relative to an explicit source white point to sRGB.
Parameters
- x double
- y double
- z double
- sourceWhiteX double = 0.95047
- sourceWhiteY double = 1
- sourceWhiteZ double = 1.08883
Returns
OfficeColor