Created
January 30, 2024 08:41
-
-
Save liamgriffin/35d698ed5f998de9cd11d31669cef7f5 to your computer and use it in GitHub Desktop.
Color Swatches Picker Logic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if value.swatch.image | |
assign image_url = value.swatch.image | image_url: width: 50 | |
assign swatch_value = 'url(' | append: image_url | append: ')' | |
elsif value.swatch.color | |
assign swatch_value = 'rgb(' | append: value.swatch.color.rgb | append: ')' | |
else | |
assign swatch_value = nil | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment