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 d657c17 commit 12f454e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/nationalarchives/variables/_colour.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ $colour-palette-brand: (

@function hex-to-rgb($hex, $opacity: 1) {
@if $opacity == 1 {
@return "rgb(" + red($hex) + " " + green($hex) + " " + 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 12f454e

Please sign in to comment.