Reputation: 3867
If I have a color code in sass
in a hexadecimal format #aaaaaa
, is there any way to convert this to an RGB format, and get only the red value number with a function?
An example on what I would like to achieve:
@function getRedValue($color) {
// convert $color which will be provided in hexadecimal format, to rgba
// return the red value of the color number
}
Upvotes: 0
Views: 103
Reputation: 790
There are some SASS default color functions you could use.
Please check red()
, green()
and blue()
.
Upvotes: 1