Share via


SPColor.GetColorShadeByName method

Get a color from this palette by its name

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Function GetColorShadeByName ( _
    name As String, _
    fixContrast As Boolean _
) As Nullable(Of Color)
'Usage
Dim instance As SPColor
Dim name As String
Dim fixContrast As Boolean
Dim returnValue As Nullable(Of Color)

returnValue = instance.GetColorShadeByName(name, _
    fixContrast)
public Nullable<Color> GetColorShadeByName(
    string name,
    bool fixContrast
)

Parameters

  • name
    Type: System.String

    The name of the color slot being requested. This may also include a shade name. For example, "BackgroundOverlay" and "BackgroundOverlay-Lighter"

  • fixContrast
    Type: System.Boolean

    Whether to fix the color contrast on non-default shades if this is an inverted theme

Return value

Type: System.Nullable<Color>
The color for the specified slot, or null if the slot does not exist in this palette.

See also

Reference

SPColor class

SPColor members

Microsoft.SharePoint.Utilities namespace