--- title: "cssColor" slug: "calc-function-css-color" updated: 2026-05-12T12:45:57Z published: 2026-05-12T12:45:57Z canonical: "docs.lobstersoftware.com/calc-function-css-color" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # cssColor > [!NOTE] > Attempts to convert any input value into a CSS color value (e.g. 9965381 into #980F45). > > The input value can also be the name of a style color variable (e.g. primaryColor). > > > [!TIP] > > **Tooltip** > > > > Syntax: *$cssColor(value)* > > > > | Parameter | Description | > > | --- | --- | > > | `value` | A value to be converted to the color value. The following formats are supported: - Numbers (Color as integer e.g. 9965381) - Hexadecimal (e.g. #980F45, 0x980F45, 980F45) - Style variable name (e.g. primaryColor) | > > > > Returns the converted color value or zero if the input value could not be converted. > > > > Examples: $cssColor(primaryColor) – Delivers by default (#980F45)$cssColor(9965381) – Delivers #980F45 ## Syntax *$cssColor(value)* ## Parameter | Name | Description | | --- | --- | | value | A value to be converted to the color value. The following formats are supported: - Numbers (Color as integer e.g. 9965381) - Hexadecimal (e.g. #980F45, 0x980F45, 980F45) - Style variable name (e.g. primaryColor) | ## Return value The converted color value back or null if the input value could not be converted. **Hint:** A corresponding contrast color, which allows writing on background colors, can be derived using the [contrastColor (Calculate contrast color)](/v1/docs/en/calc-function-contrast-color) function.