diff --git a/webpage/BetterBash/src/App.vue b/webpage/BetterBash/src/App.vue index 6d0015d..0cae4d3 100644 --- a/webpage/BetterBash/src/App.vue +++ b/webpage/BetterBash/src/App.vue @@ -24,7 +24,7 @@ :value="colorOpt.value" > {{ colorOpt.name }} - +
@@ -134,23 +134,63 @@
+
+

Share Your Theme

+
+ + +
+

Copied to clipboard!

+
+

About This Customizer

This tool allows you to customize the colors of your bash PS1 prompt. Select different terminal colors for each component and individually toggle "light" (bright) or "bold" styles to see how they - look in the preview. + look in the preview. You can share your theme using the URL generated above.

+

Decoding the Share URL

+
+

The string after "betterba.sh/" in the URL is an 8-character code representing your theme. Here's how it works:

+
    +
  1. Fixed Order: Colors are encoded for 9 components in this fixed order: + Primary, Secondary, Root User, Time, Error Code, Separator, Border, Path, and Reset colors.
  2. +
  3. Per-Component Encoding (5 bits): +
      +
    • Base Color (30-37) is mapped to 0-7 (3 bits).
    • +
    • Light State (normal/bright) is 0 or 1 (1 bit).
    • +
    • Bold State is 0 or 1 (1 bit).
    • +
    • These are combined: (base_color_0_7 << 2) | (light_bit << 1) | bold_bit.
    • +
    +
  4. +
  5. Concatenation (45 bits): The 9 five-bit values are joined, forming a 45-bit sequence.
  6. +
  7. Byte Packing (6 bytes): These 45 bits are packed into 6 bytes. The first 45 bits contain the data, and the last 3 bits of the 6th byte are zero-padded. Bits are packed MSB-first from the component data into the bytes. +
      +
    • Byte 1: C1_b4 C1_b3 C1_b2 C1_b1 C1_b0 C2_b4 C2_b3 C2_b2
    • +
    • Byte 2: C2_b1 C2_b0 C3_b4 C3_b3 C3_b2 C3_b1 C3_b0 C4_b4
    • +
    • Byte 3: C4_b3 C4_b2 C4_b1 C4_b0 C5_b4 C5_b3 C5_b2 C5_b1
    • +
    • Byte 4: C5_b0 C6_b4 C6_b3 C6_b2 C6_b1 C6_b0 C7_b4 C7_b3
    • +
    • Byte 5: C7_b2 C7_b1 C7_b0 C8_b4 C8_b3 C8_b2 C8_b1 C8_b0
    • +
    • Byte 6: C9_b4 C9_b3 C9_b2 C9_b1 C9_b0 0 0 0
    • + (Cn_bx is bit x of component n's 5-bit value, C1=Primary, C2=Secondary, etc.) +
    +
  8. +
  9. URL-Safe Base64: The 6 bytes are encoded using Base64, then + is replaced with -, / with _, and padding = are removed. This produces the 8-character code.
  10. +
+

To decode, reverse the process: Base64 decode, unpack bytes into 5-bit values, then extract base color, light, and bold states for each component.

+