1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.30 Bug Reporting thread
    Solutions and more information may already be available.

How to convert color code?

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by Sky777, Feb 4, 2022.

  1. Sky777

    Sky777
    Expand Collapse

    Joined:
    Oct 9, 2021
    Messages:
    7
    I have recently found the file to add colors to the Factory palette for cars, and it's exciting to me, as I love messing around with colors!!!
    However, I am unsure how to convert color values to this RGBA decimal value, as I have never seen this before. I would really like to take values from HEX codes and convert it to this format. Is there a conversion website to do this? I have looked and could not find one. Any help is appreciated, Thank you very much! :)
    Code:
            "Black": {
                "baseColor": [ 0.01, 0.01, 0.01, 2 ],
                "clearcoat": 1,
                "clearcoatRoughness": 0,
                "metallic": 0.5,
                "roughness": 0.175
            },
            "White": {
                "baseColor": [ 1, 1, 1, 2 ],
                "clearcoat": 1,
                "clearcoatRoughness": 0,
                "metallic": 0.5,
                "roughness": 0.175
            },
            "Red": {
                "baseColor": [ 0.7, 0.1, 0.1, 2 ],
                "clearcoat": 1,
                "clearcoatRoughness": 0,
                "metallic": 0.5,
                "roughness": 0.175
     
  2. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,053
    I do it via some random online converter and a calculator, idk if there is an easier way
     
  3. Nivracer

    Nivracer
    Expand Collapse

    Joined:
    Jan 23, 2014
    Messages:
    370
    Don't use hex values to try and convert. The "baseColor" uses a decimal variation of RGB where 255 = 1.0

    say you want to make a green color with the RGB values 42, 191, 34
    Take the RGB vaules and divide them by 255
    42/255 = 0.17
    191/255 =0.75
    34/255 = 0.13

    now your baseColor value will look like this

    Code:
    "baseColor": [ 0.17, 0.75, 0.13, 2 ],
    
     
  4. Sky777

    Sky777
    Expand Collapse

    Joined:
    Oct 9, 2021
    Messages:
    7
    Pretty easy, thank you!!! :) Do you know what this variation is called? MYCK for example? Also, what do you do with the darkness (Or transparency?? IDK) factor, the last number?
    --- Post updated ---
    Would you like to paste the website address?
     
  5. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,053
    I usually just use the one that comes up first when you google "Hex to RGB", it's good enough
     
  6. Nivracer

    Nivracer
    Expand Collapse

    Joined:
    Jan 23, 2014
    Messages:
    370
    Not sure what the fourth value is. I'd play around with the number and see what it does.
     
  7. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,053
    Fourth value is chrominess, it's not used in game anymore, but needs to be there for compatibility with old mods
     
  8. Sky777

    Sky777
    Expand Collapse

    Joined:
    Oct 9, 2021
    Messages:
    7
    Yes, I saw that... But I do think it is necessary, even for new mods... It seemed to change the chrominess of my newest Automation mod.
     
  9. Newtomic

    Newtomic
    Expand Collapse

    Joined:
    Jan 16, 2023
    Messages:
    6
    Hi all, sorry for being awaking this old thread.
    I make a very small tool in Google Sheets to assist me with the colors in BeamNG.drive, and I feel like sharing it.
    BeamNG.drive - ColorConverter
    Any suggestions or other's are welcome.
     
  10. Sky777

    Sky777
    Expand Collapse

    Joined:
    Oct 9, 2021
    Messages:
    7
    Nice! I might use it soon ;)
     
  11. Leo Zieger

    Leo Zieger
    Expand Collapse

    Joined:
    Jan 12, 2023
    Messages:
    609
    I wonder if there is a way to find out RGB codes for real car colours, for instance my ex-Mazda RX-8 velocity red 27a?
     
  12. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,053
    It is possible but not worth it since pretty much every BeamNG update nowadays changes something in the lighting and the colors end up looking a bit different so recreating real colors is not possible reliably
     
  13. Newtomic

    Newtomic
    Expand Collapse

    Joined:
    Jan 16, 2023
    Messages:
    6
    Cool, if you or someone else find anything that want to change/suggest please say something. :)
     
    • Like Like x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice