Skip to content

Commit

Permalink
Fix hex-to-rgb function
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Oct 11, 2023
1 parent 12f454e commit e2e559e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/nationalarchives/variables/_colour.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ $colour-palette-brand: (

@function hex-to-rgb($hex, $opacity: 1) {
@if $opacity == 1 {
@debug ($hex);
@debug (red($hex));
@debug (green($hex));
@debug (blue($hex));
@return rgb(red($hex) green($hex) blue($hex));
} @else {
@return rgb(red($hex) green($hex) blue($hex) / $opacity);
@return rgb(red($hex) green($hex) blue($hex) / #{$opacity});
}
}

Expand Down

0 comments on commit e2e559e

Please sign in to comment.