Hex RGBA to ARGB

by Ricardo “Rudxain” Fernández Serrata

Version 1 (December 1, 2023)

Download (17 downloads)

#0Af7 => 7700AAff

Convert CSS hex color to AM-compatible color. "#" can be omitted. Alpha channel can also be omitted. This is intended to be embedded in flows (without dialog-blocks)

How it works (algorithm):
1. Trim spaces, and remove optional "#".
2. Expand shorthand notation (if short).
3. Move last 2 nibbles to the start, if they are alpha. This is also known as a "circular shift" or "string rotation".

Regex dotall flag and possessive quantifiers are only used for performance.

Rudxain profile: llamalab.com/automate/community/flows/42921

Tags: format 0x

LICENSE: https://unlicense.org

3.0 average rating from 1 reviews

5 stars
0
4 stars
0
3 stars
1
2 stars
0
1 star
0
Reports
0

Rate and review within the app in the Community section.