Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

60%
+1 −0
Challenges Expand a greyscale/colour hex code

Uiua, 19 bytes (SBCS) Defines a function that takes the string and returns a string: ⊂@#♭⍥⍉⊙(↯2_3)=3⊸⧻↘1 Uiua Pad this online Explanation ⊂@#♭⍥⍉⊙(↯2_3)=3⊸⧻↘1 "#ABC" example input ...

posted 6mo ago by ojdo‭

Answer
#1: Initial revision by user avatar ojdo‭ · 2026-03-09T16:01:30Z (6 months ago)
# [Uiua](https://uiua.org/), 19 bytes (SBCS)

Defines a function that takes the string and returns a string:

```uiua
⊂@#♭⍥⍉⊙(↯2_3)=3⊸⧻↘1
```

[Uiua Pad this online](https://uiua.org/pad?src=0_19_0-dev_1__eJxdzzEKAjEQBdB-TxF2G-3cJGJSCK5hcw3vYhHYQMDS9CtWYit4m38SSSbN-Kf58ODDeIFwE4jX04D8QnogLYh5g_CWF7U9KsQPnl-E-9ghrVgzliT6YVfTC196z2iqIZo4ybkckZy56Royrf8nnfO-TTrP0VpjrCW0xnI81BCWwp8YpdL79gR15uca8ta7H4DkboQ=)

## Explanation

```text
⊂@#♭⍥⍉⊙(↯2_3)=3⊸⧻↘1   "#ABC"    example input
                    ↘1   "ABC"     drop first character (the "#")
                  ⊸⧻     3 "ABC"   push length, keep argument after result
                =3       1 "ABC"   is length equal to 3?
        ⊙(              "ABC"     dip: while ignoring top of stack
           ↯2_3          ["ABC" "ABC"]  reshape to 2x3 array (repeating)
               )         1 ["ABC" "ABC"]  dip finishes
    ⍥⍉                 ["AA" "BB" "CC"] repeat-transpose:
                            top of stack (here: 1) determines how often
                            to repeat applying the next function 
                            (here: transpose). In other words: `if`
   ♭                     "AABBCC"  flatten array
⊂@#                      "#AABBCC" push '#' and join
```