babbleon Posted January 31, 2018 Share Posted January 31, 2018 Hello, This makes loading screen white: engine.loadingUIBackgroundColor = new BABYLON.Color3(0.6, 0.6, 0.6); Am I being hard of thinking? I appreciate the colour should be a string, but how to I convert RGB vales to a string? Cheers, Quote Link to comment Share on other sites More sharing options...
babbleon Posted January 31, 2018 Author Share Posted January 31, 2018 Here's a workaround (taken from here: https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb) function componentToHex(c) { var hex = c.toString(16); return hex.length == 1 ? "0" + hex : hex; } function rgbToHex(r, g, b) { return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b); } engine.loadingUIBackgroundColor = rgbToHex(0.6*255, 0.6*255, 0.6*255); So, sort of solved unless anyone knows an easier way? Quote Link to comment Share on other sites More sharing options...
MarianG Posted January 31, 2018 Share Posted January 31, 2018 You have this BABYLON.Color3.FromHexString("#000000"); and back you have this yourColor.tohexstring() Quote Link to comment Share on other sites More sharing options...
babbleon Posted January 31, 2018 Author Share Posted January 31, 2018 Thank you MarianG... engine.loadingUIBackgroundColor = new BABYLON.Color3(0.6, 0.6, 0.6).toHexString(); ...works perfectly. GameMonetize and MarianG 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.