A DAX UDF library for manipulation of hex colours for Power BI
- Download the library from DaxLib
- Install using TMDL view
- Start using the functions in your measures
For detailed examples, check out our example PBIP file.
Hex.ToInt- Convert hex colour to integer formatInt.ToHex- Convert integer to hex colour formatRGB.ToHex- Transform RGB values to hex colourHSL.ToHex- Convert HSL color to hex format
Hex.Hue- Extract hue component from hex colourHex.Saturation- Extract saturation component from hex colourHex.Luminance- Extract luminance component from hex colourHex.Alpha- Extract alpha channel from hex colourHex.AdjustHue- Adjust the hue of a hex colourHex.AdjustSaturation- Adjust the saturation of a hex colourHex.AdjustLuminance- Adjust the luminance of a hex colourHex.AdjustAlpha- Adjust the alpha channel of a hex colourHex.AdjustColour- Adjust multiple colour properties simultaneouslyHex.TextColour- Determine optimal text colour (black or white) for contrast
Hex.Theme- Use pre-built color palettesHex.LinearTheme- Build linear color themesHex.Interpolate- Create smooth color transitions between colours
Full documentation is available at our GitHub Pages site.