cancel
Showing results for 
Search instead for 
Did you mean: 

Error on adding RGB color in less

SOLVED

Error on adding RGB color in less

Hi 

I have added in RGB color in less files but its not working and got this error.

main.CRITICAL: error evaluating function `rgba` color functions take numbers as parameters index: 14028 {"exception":"[object] (Magento\\Framework\\View\\Asset\\ContentProcessorException(code: 0): error evaluating function `rgba` color functions take numbers as parameters index: 14028 at

 Can any one help me 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Error on adding RGB color in less

Have you tried the following method?

 

@baseColor: #d24d36;

 

body {

 color: rgba(red(@baseColor), green(@baseColor), blue(@baseColor), 1);

 }

 

Check rgba to hexa code here

 https://lesstester.com/

 

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

View solution in original post

Re: Error on adding RGB color in less

Here's a way to add box-shadow:
 
@baseColor: #888788; // change color as per you need
 
div {
box-shadow: 0 0 3px rgba(red(@baseColor), green(@baseColor), blue(@baseColor), 1);
}
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

View solution in original post

4 REPLIES 4

Re: Error on adding RGB color in less

Have you tried the following method?

 

@baseColor: #d24d36;

 

body {

 color: rgba(red(@baseColor), green(@baseColor), blue(@baseColor), 1);

 }

 

Check rgba to hexa code here

 https://lesstester.com/

 

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

View solution in original post

Re: Error on adding RGB color in less

Thanks for help can you please tell me how can I add 

box-shadow: 0 0 3px rgb(0 0 0 / 30%)

Re: Error on adding RGB color in less

Here's a way to add box-shadow:
 
@baseColor: #888788; // change color as per you need
 
div {
box-shadow: 0 0 3px rgba(red(@baseColor), green(@baseColor), blue(@baseColor), 1);
}
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

View solution in original post

Re: Error on adding RGB color in less

Thanx Sanjay!

You are awesome Smiley Happy