Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

Color Gradient Highlight

TydasTydas Posts: 232Member ✭✭✭ - Distinguished
So, a while back, I think it was @Regi who showed some of us on a clan that he likes to highlight some people's names in such a way, that the leftmost character starts off in one color and smoothly moves into another color at the rightmost character. The result was kind of cool, and for a while I've considered writing a general script to do it myself. While looking into it, I found not only RGB gradients, but an HSV and inverse HSV gradient as well, and decided to incorporate those as options. The HSV tends to preserve how intense/bright the colors are in the gradient, while RGB tends to get a little dark.

Source code is here. Just throw it all into a script, then call colorGrad(string, left_color_hex_string, right_color_hex_string, optional_gradient_type). RGB is default, 1 is HSV, 2 is HSV inverse. It returns a string that you plug into hecho. Sorry if it's a little weird, I've been sick and I wrote most of it while I was pretty tired.

Here's what it looks like. RGB, HSV, HSV-inverse, in that order, with different colors I chose mostly at random.

No idea if anyone would actually want it, but it was fun to make.
TahquilKyrraNataliiaCoamenelExelethril

Comments

  • TahquilTahquil Posts: 3,704Member @@ - Legendary Achaean
    -cackles-
    YOU'LL BE PRAYING TO THE GODS FOR YOUR EYES BACK ONCE I START POSTING LOGS UP IN HERE>
  • KyrraKyrra Sanctum of the SkyPosts: 4,289Member @@ - Legendary Achaean
    That one third from the bottom is so pretty! I'd love something like this.
    (D.M.A.): Cooper says, "Kyrra is either the most innocent person in the world, or the girl who uses the most innuendo seemingly unintentionally but really on purpose."

  • KenwayKenway San FranciscoPosts: 1,120Member @@ - Legendary Achaean
    Oh that's neato. Might replace my rainbow crits with these. Maybe recolor my dsb echoes

    - Limb Counter - Fracture Relapsing -
    "Honestly, I just love that it counts limbs." - Mizik Corten
  • TydasTydas Posts: 232Member ✭✭✭ - Distinguished
    So, small problem. I forgot to reset the format of the hecho. It's not a huge deal depending on how you're using it, but here's the script with that problem fixed.
  • NataliiaNataliia Posts: 305Member ✭✭✭✭ - Eminent
    Kenway said:
    Oh that's neato. Might replace my rainbow crits with these. Maybe recolor my dsb echoes
    You read my mind!! So when you get that working for you... you know how to get ahold of me. <3
    Kenway
  • CoamenelCoamenel Posts: 186Member ✭✭✭ - Distinguished
    I stole this function. Not sure what I'm going to do with it, but it's to cool to let go.
    Exelethril
  • RegiRegi Posts: 18Member ✭✭✭ - Distinguished
    Nicely done @Tydas, my script actually colors each letter individually and I have to assign RGB values manually to the target words or phrases. I also didn't write it, was shared with me by an old now retired friend, not sure if she wrote it or if not where she got it from though.

    This is good work, hope lots of people enjoy it.
  • TahquilTahquil Posts: 3,704Member @@ - Legendary Achaean
    @Tydas. I actually meant this script. Can you put this script to work with the data for svof politics?
  • KeneanungKeneanung Posts: 528Member ✭✭✭✭ - Eminent
    Tahquil said:
    @Tydas. I actually meant this script. Can you put this script to work with the data for svof politics?
    Not in svof itself, you could use the data to do something with it.

    If there was a way to use it on existing text (the namedb uses selectString), I could probably implement something to allow the usage of arbitrary functions for highlighting.
  • TahquilTahquil Posts: 3,704Member @@ - Legendary Achaean
    yus pls. Go go go.
Sign In to Comment.