Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Convert Hex to RGB in AEM 6.5

Avatar

Avatar
Validate 1
Level 1
sunitac93243435
Level 1

Likes

2 likes

Total Posts

20 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
sunitac93243435
Level 1

Likes

2 likes

Total Posts

20 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
sunitac93243435
Level 1

28-01-2020

Dear All,

 

I am getting my hex color from dialog to Html by using below.

 

dialog

<navBackGroundColor
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldDescription="Enter the Navigation component background color Hex code"
fieldLabel="Navigation Component Background Color Hex Code"
hexvalidator="hexvalidation"
name="./navigationBackGroundColor"/>

 

HTL

<style>
.sunitaNavigation .stickyNav {
background-color: rgb(${properties.navigationBackGroundColor @CONTEXT='styleString'});
}
</style>

 

<td class="mandatoryField">
${properties.navigationBackGroundColor}
<p style="background-color:${properties.navigationBackGroundColor @ context='scriptString'}">${properties.navigationBackGroundColor}</p>
</td>

 

Now in my css (already i called in HTL in above) , I want rgb like below.

 

<style>
.sunitaNavigation .stickyNav {
background-color: rgb(${properties.navigationBackGroundColor @CONTEXT='styleString'});
}
</style>

 

But my color is not coming in rgb..it is coming in hex only. Do I need to convert Hex to RGB ?

 

How can I achieve this ?

 

Please suggest.

 

 

Accepted Solutions (0)

Answers (0)