<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to use Opacity in the Custom Module Color Picker in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/201302#M7480</link>
    <description>&lt;P&gt;Thanks! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Stephanie O'Gay Garcia&lt;/STRONG&gt;&lt;BR /&gt;HubSpot Design / Development / Automation&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank"&gt;Website&lt;/A&gt; | &lt;A href="http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity" target="_blank"&gt;Contact&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Aug 2018 19:49:08 GMT</pubDate>
    <dc:creator>Stephanie-OG</dc:creator>
    <dc:date>2018-08-08T19:49:08Z</dc:date>
    <item>
      <title>How to use Opacity in the Custom Module Color Picker</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/201124#M7455</link>
      <description>&lt;P&gt;I was about to post this as a question as it took me a while to figure out (&lt;img id="smileyembarrassed" class="emoticon emoticon-smileyembarrassed" src="https://community.hubspot.com/i/smilies/16x16_smiley-embarrassed.png" alt="Smiley Embarassed" title="Smiley Embarassed" /&gt;).&amp;nbsp; Since I couldn't find any documentation I figure I'll share for anyone who might look for this in the future.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt; Opacity for a background element will apply to children as well so the below is great for text but not background colours... Any alternatives would be great!&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;EDIT NUMBER TWO:&lt;/STRONG&gt; I've found &lt;A href="https://designers.hubspot.com/docs/hubl/hubl-supported-filters" target="_self"&gt;the convert_rgb filter&lt;/A&gt; for HubL which answers my question:&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;div style="background: rgba({{ widget_data.my_color.color|convert_rgb }}, .5)"&amp;gt;&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In custom modules you can use a "Color" field which allows users to pick a colour and opacity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bgcolor.png" style="width: 485px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/11014i6F6702039BC934E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="bgcolor.png" alt="bgcolor.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this field is named background_color, for example, it gives you the following snippets:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Colour:&lt;/STRONG&gt;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;{{ module.background_colour.color }}&amp;nbsp;&lt;/FONT&gt;with the output #c82929&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Opacity:&lt;/STRONG&gt; &lt;FONT face="courier new,courier"&gt;{{ module.background_colour.opacity }}&lt;/FONT&gt; with the output 32&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In CSS, opacity takes values from&amp;nbsp;&lt;SPAN&gt;0.0 - 1.0 so I wasn't sure how to fit in the "32" value (one it got to 0.100 it didn't like that at all) so I finally figured I could use calc and math to divide the number by 100.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To use the above you can do the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;.myClass {
&amp;nbsp;background-color: {{ module.background_colour.color }};
&amp;nbsp;opacity: &lt;STRONG&gt;calc(&lt;/STRONG&gt;{{ module.background_colour.opacity }} &lt;STRONG&gt;/ 100);&lt;/STRONG&gt;
}&lt;/PRE&gt;&lt;P&gt;And voilà!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Their own colour picker in a Rich Text module, for example, uses an RGBA output for opacity so it must work differently:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="colorpicker.png" style="width: 632px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/11015iCD4E9E4BF5D7442A/image-size/large?v=v2&amp;amp;px=999" role="button" title="colorpicker.png" alt="colorpicker.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Stephanie O'Gay Garcia&lt;/STRONG&gt;&lt;BR /&gt;HubSpot Design / Development / Automation&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank"&gt;Website&lt;/A&gt; | &lt;A href="http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity" target="_blank"&gt;Contact&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 20:15:41 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/201124#M7455</guid>
      <dc:creator>Stephanie-OG</dc:creator>
      <dc:date>2018-09-06T20:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Opacity in the Custom Module Color Picker</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/201180#M7469</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt;&amp;nbsp;- Good find on the '&lt;STRONG&gt;calc&lt;/STRONG&gt;'!&lt;/P&gt;&lt;P&gt;I think these should work as well...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; 
.myClass {     
      opacity: {{'0.'+bg if module.background_colour.opacity &amp;lt; 100 else '1'}};
      opacity: {{module.background_colour.opacity / 100}};
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 12:05:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/201180#M7469</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-08-08T12:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Opacity in the Custom Module Color Picker</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/201264#M7476</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/2450"&gt;@tjoyce&lt;/a&gt;! Those both work too. The only problem now is that I want to use it for a background-color and using "opacity" dims the opacity for everything in my container (not just the background colour).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So RGBA would be great... maybe it's an Ideas forum suggestion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Stephanie O'Gay Garcia&lt;/STRONG&gt;&lt;BR /&gt;HubSpot Design / Development / Automation&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank"&gt;Website&lt;/A&gt; | &lt;A href="http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity" target="_blank"&gt;Contact&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 16:12:09 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/201264#M7476</guid>
      <dc:creator>Stephanie-OG</dc:creator>
      <dc:date>2018-08-08T16:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Opacity in the Custom Module Color Picker</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/201272#M7477</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt;&amp;nbsp;- I run into that dillema all the time, this is how I solve it -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;div class="wrapper"&amp;gt;
  &amp;lt;div class="overlay"&amp;gt;
    ..your content here
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;P&gt;I do this:&lt;/P&gt;&lt;PRE&gt;&amp;lt;div class="wrapper" style="position:relative"&amp;gt;
  &amp;lt;div class="overlay" style="width:100%;height:100%;left:0;top:0;color:blue;opacity:0.5;"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class="my-content" style="width:100%;height:100%;left:0;top:0"&amp;gt;
  ... my content here
  &amp;lt;/div&amp;gt;  
&amp;lt;/div&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Aug 2018 16:40:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/201272#M7477</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-08-08T16:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Opacity in the Custom Module Color Picker</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/201302#M7480</link>
      <description>&lt;P&gt;Thanks! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Stephanie O'Gay Garcia&lt;/STRONG&gt;&lt;BR /&gt;HubSpot Design / Development / Automation&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank"&gt;Website&lt;/A&gt; | &lt;A href="http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity" target="_blank"&gt;Contact&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 19:49:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/201302#M7480</guid>
      <dc:creator>Stephanie-OG</dc:creator>
      <dc:date>2018-08-08T19:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Opacity in the Custom Module Color Picker</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/244721#M10503</link>
      <description>&lt;P&gt;not to ever contest &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/2450"&gt;@tjoyce&lt;/a&gt;, but you may need to add some z-index action to this and positions to the wrapper children &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 16:41:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/244721#M10503</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2019-01-08T16:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Opacity in the Custom Module Color Picker</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/257287#M11333</link>
      <description>&lt;P&gt;I was stuggling with a similar issue and thanks to this post I ended up with a hybrid. I didn't want to add any code and wanted to change the background colour and have anoption for opacity. I found a way by combining a choice field with a number field.&amp;nbsp; Thought I would share in case someone else finds it helpful.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The choice field adds the hex code&lt;/LI&gt;&lt;LI&gt;Convert to hex to RGB&lt;/LI&gt;&lt;LI&gt;Set opacity to equal the number field&lt;/LI&gt;&lt;LI&gt;Number field maxes out&amp;nbsp;@ 99&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;div class="text-row-wrapper" style="background-color: rgba({{ module.bg_colour|convert_rgb }}, .{{ module.number_field }});"&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="colour.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/15533iE4F471DDCC9352E8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="colour.png" alt="colour.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bg-opacity.png" style="width: 313px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/15535i676858E5BC9481E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bg-opacity.png" alt="bg-opacity.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-03-05 at 2.57.03 PM.png" style="width: 784px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/15536iD72532D46FE1FFCF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-03-05 at 2.57.03 PM.png" alt="Screen Shot 2019-03-05 at 2.57.03 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 22:02:53 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/257287#M11333</guid>
      <dc:creator>MrCapp</dc:creator>
      <dc:date>2019-03-05T22:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Opacity in the Custom Module Color Picker</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/306025#M14560</link>
      <description>&lt;P&gt;I know it's an old problem but here's what I did, I got the idea from calc CSS function that you used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% set opacity =&amp;nbsp; {{module.content_backround_color.color|convert_rgb }} / 100 %}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;background-color: rgba({{module.content_backround_color.color|convert_rgb }}, {{opacity}});&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 07:02:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/306025#M14560</guid>
      <dc:creator>johnsardanas</dc:creator>
      <dc:date>2019-12-06T07:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Opacity in the Custom Module Color Picker</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/314551#M15055</link>
      <description>&lt;P&gt;I wrote out a tutorial for this as well:&amp;nbsp;&lt;A href="https://community.hubspot.com/t5/CMS-Development/Creating-a-background-image-background-color-widget/m-p/272763/highlight/true#M12435" target="_blank"&gt;https://community.hubspot.com/t5/CMS-Development/Creating-a-background-image-background-color-widget/m-p/272763/highlight/true#M12435&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 22:59:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/314551#M15055</guid>
      <dc:creator>Jsum</dc:creator>
      <dc:date>2020-01-24T22:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Opacity in the Custom Module Color Picker</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/1058153#M41045</link>
      <description>&lt;P&gt;Awesome. I get it working with something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% set button_bg = "rgba({{ theme.buttons.standard_button.background.color.color|convert_rgb }}, {{theme.buttons.standard_button.background.color.opacity}}%)" %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I have one question.&lt;BR /&gt;How can I prevent the user from leaving the opacity field empty?&lt;BR /&gt;It would be helpful if the default value is settled when the field empties.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 20:59:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-use-Opacity-in-the-Custom-Module-Color-Picker/m-p/1058153#M41045</guid>
      <dc:creator>Javieru</dc:creator>
      <dc:date>2024-10-21T20:59:47Z</dc:date>
    </item>
  </channel>
</rss>

