Tutorial Found Transparent Color Code. Somehow.

Discussion in 'Starbound Modding' started by Jaxine, Feb 27, 2017.

  1. Jaxine

    Jaxine Pangalactic Porcupine

    Yeah, I have no idea if tagging it as "Tool" is correct, Admins will fix it if not. Also don't know if anyone else has this already posted somewhere handy. But I found a color code for re-coloring any spawnable item with completely invisible color, thus removing JUST that specific color from the item completely. In Hex Color Code:

    -Black is 000000,
    -White is ffffff,
    -I have been told (see below) adding numbers to the end is ow you edit the transparency of the Hex Code.
    -So ffffff00 is "Full Transparant White".
    -i was also told about "Simplified Hex Color Code".
    -fff = White, 000 = Black. fff0 = White Transparent, 0000 = Black Transparent.
    and so on.


    If you just put "0000" (four zeros) it removes the color. As does "00000000" (eight zeros). Any 3 digits followed by 0 or any 6 digits followed by 00 is invisible.


    Example: Spawn this in your game.

    Code:
    /spawnitem apextier1head 1 '{"shortdescription": "Blue Eyes","description" : "Brilliant Blue Eyes.","level" : 10,"directives": "?replace;cc0016=0080ff;ffca8a=0000;e0975c=0000;a85636=0000;6f2919=0000;"}'
    This was originally the Defector's Mask, the Tier 1 Apex Headgear. I turned all the other colors Transparent, and turned the red eyes blue.

    I found Nanocharat's "Manual Clothing Recolor" Tutorial to be the closest thing on here that would have this info, but it does not. Maybe add this to it or something?

    (The rest of the post is just me explaining how I found it. Ignore if you wish :nuruhappy:)

    And how did I find it? Well, I tried using Hex codes like "00ffffff" where "00" is a Hex code for opacity. That color would be "Transparent White". This is an actual Hex color code that exists. Didn't work. I tried other codes like "ffffff00" <-(Edit-I did this one wrong before, it works as "Transparent White".), "ccffffff", "#00ffffff", and even "??ffffff". And nada.
    Then came RGB (Red, Green, Blue) Color Codes. Like:
    -255,255,255 is White in RGB,
    -0,0,0 is black.

    Then came the breakthrough...

    RGBA.

    Transparency, or Opacity is also refereed to as "Alpha Channel". RGBA has values for Red, Green, Blue, and Alpha, or Alpha Channel, witch is the Transparency value.
    -"Solid or Full White" in RGBA is 255,255,255,1
    -"Half-Transparent White" is 255,255,255,0.5
    -"Transparent White" is 255,255,255,0
    So I be like "I can just use Transparent Black, right?" or "0,0,0,0". So I punched in a few codes to test out:

    "directives": "?replace;
    6f2919=(0,0,0,0);",

    "directives": "?replace;
    6f2919=0,0,0,0;",

    "directives": "?replace;
    6f2919=0 0 0 0;",

    Nada. Until:

    "directives": "?replace;
    6f2919=0000;",

    BOOM! VICTORY!

    So, now that I'm all proud of myself, I'm just waiting for everyone to be like "yeah... we know." and "It's already posted in this overly-obvious post." or something. But meh, threw it up here :nuruhype: just in-case.

    Continued -

    So @IHart and @lazarus78 weighed in on this and explained the Hex Code in better detail. So my amazing RGBA findings simply paved the way to finding this on a fluke! But thats fine, I love learning how things really work. Now that I have full transparency options for any hex color, I can have some fun with this!
     
    Last edited: Feb 28, 2017
    IHart, xaliber and ImHereForTheMods like this.
  2. IHart

    IHart Scruffy Nerf-Herder

    What you found is different than what you think you found. The term for it escapes me but essentially there are two ways to do hex colors, with two digits representing each layer, and with one digit representing each layer. You will find if you do fff you will also get white.
    Defining the first three layers is required. the fourth layer is optional, and represents the alpha.

    TLDR;
    1) fff = ffffff
    2) try 2468, you will have fun, i promise
     
  3. lazarus78

    lazarus78 The Waste of Time

    Yup. color hex codes are broken down into 4 groups of 2 digits. (RRGGBBAA) The first 2 represent red, the next are green, and the next are blue, and the last are for alpha. If you don't define the alpha, it basically assumes full opacity. And since a double hex value translates into decimal values of 0-255, you can easily translate to RGB values.

    The 3/4 digit method is just for simplification. If you have 0066AA, it can be simplified to just 06A. The doubling up is redundant information
     
  4. Errors4l

    Errors4l Spaceman Spiff

  5. Jaxine

    Jaxine Pangalactic Porcupine


    Well damn. lol I did accidentally find it I guess. I was also WRONG, #ffffff00 did make "Transparent White". #2468 worked, as did #22446688. I'm going to add these findings to my first post.

    So, are "0001" and "00000010" both codes for "90% Transparent Black", and "0009" and "00000090 both codes for "10% Transparent Black" ?
     
    Last edited: Feb 28, 2017
  6. Errors4l

    Errors4l Spaceman Spiff

    No, the value is repeated. 0001 would be 00000011 just like 2468 is q22446688. 00000011 would be black with 17/255 alpha (roughly 7% opaque).
     
  7. Jaxine

    Jaxine Pangalactic Porcupine

    Ooohhhh right, the 0001 - 0000000011 thing makes sense, but that's only 7%? so does that make 00000099 like 92%-ish, or only around 63%-ish, where you would then use 000000aa-000000ff or something?

    [​IMG]
     
    Last edited: Feb 28, 2017
  8. IHart

    IHart Scruffy Nerf-Herder

    the latter, 60%
     
    Errors4l likes this.
  9. Nexus Of Chaos

    Nexus Of Chaos Parsec Taste Tester

    i've known this even b4 I first played SB.
     
  10. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    As a point of random input, hexadecimal is a base 16 number set (Numbers 0 to 9, and letters A to F), whereas most generic systems use base 10 (Numbers 0 to 9 ONLY).

    So numbers don't increment from 9 back to 0.

    For example, the value "09" would actually increment to "0A", and "0F" advances to "10" at that point.



    (Random mathematics tidbit, but just contributing for the clarification of someone who may come along and not understand.)
     
    Errors4l likes this.
  11. markelvy

    markelvy Space Hobo

    Transparency is controlled by the alpha channel (AA in #AARRGGB:cool:. Maximal value (255 dec, FF hex) means fully opaque. Minimum value (0 dec, 00 hex) means fully transparent. Values in between are semi-transparent, i.e. the color is mixed with the background color.

    To get a fully transparent color code set the alpha to zero. RR, GG and BB are irrelevant in this case because no color will be visible. This means #00FFFFFF ("transparent White") is the same color as #00F0F8FF ("transparent AliceBlue"). To keep it simple one chooses black (#00000000) or white (#00FFFFFF) if the color does not matter.
     

Share This Page