ColorType.Tint Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tint
Represents the following attribute in the schema: tint
[DocumentFormat.OpenXml.SchemaAttr(0, "tint")]
public DocumentFormat.OpenXml.DoubleValue Tint { get; set; }
public DocumentFormat.OpenXml.DoubleValue Tint { get; set; }
[DocumentFormat.OpenXml.SchemaAttr(0, "tint")]
public DocumentFormat.OpenXml.DoubleValue? Tint { get; set; }
[DocumentFormat.OpenXml.SchemaAttr("tint")]
public DocumentFormat.OpenXml.DoubleValue? Tint { get; set; }
public DocumentFormat.OpenXml.DoubleValue? Tint { get; set; }
member this.Tint : DocumentFormat.OpenXml.DoubleValue with get, set
[<DocumentFormat.OpenXml.SchemaAttr(0, "tint")>]
member this.Tint : DocumentFormat.OpenXml.DoubleValue with get, set
[<DocumentFormat.OpenXml.SchemaAttr("tint")>]
member this.Tint : DocumentFormat.OpenXml.DoubleValue with get, set
Public Property Tint As DoubleValue
Property Value
Returns DoubleValue.
- Attributes
Remarks
The following information from the ECMA International Standard ECMA-376 can be useful when working with this class.
Specifies the tint value applied to the color.
If tint
is supplied, then it is applied to the RGB value of the color to determine the final color applied.
The tint
value is stored as a double from −1.0 .. 1.0, where −1.0 means 100% darken and 1.0 means 100% lighten. Also, 0.0 means no change.
In loading the RGB value, it is converted to HLS where HLS values are (0.. HLSMAX), where HLSMAX is currently 255.
Here are some examples of how to apply tint to color:
If (tint < 0)
Lum’ = Lum * (1.0 + tint)
For example: Lum = 200; tint = −0.5; Darken 50%
Lum’ = 200 * (0.5) => 100
For example: Lum = 200; tint = −1.0; Darken 100% (make black)
Lum’ = 200 * (1.0 − 1.0) => 0
If (tint > 0)
Lum’ = Lum * (1.0 − tint) + (HLSMAX – HLSMAX * (1.0 − tint))
For example: Lum = 100; tint = 0.75; Lighten 75%
Lum’ = 100 * (1 − 0.75) + (HLSMAX – HLSMAX * (1 − 0.75))
= 100 * 0.25 + (255 – 255 * 0.25)
= 25 + (255 – 63) = 25 + 192 = 217
For example: Lum = 100; tint = 1.0; Lighten 100% (make white)
Lum’ = 100 * (1 − 1) + (HLSMAX – HLSMAX * (1 − 1))
= 100 * 0 + (255 – 255 * 0)
= 0 + (255 – 0) = 255
The possible values for this attribute are defined by the XML Schema double
data type.