1

Question - when I use the three.js editor it outputs an app.json file where color values are listed as an integer, for example:

"materials": [
{
    "uuid": "26C18ACF-3733-4B92-AC67-E25A132B27D0",
    "type": "MeshPhongMaterial",
    "color": 16777215,

I want to modify that color directly in the JSON file to some hex or RGBA equivalent, but I have no idea how to convert to whatever system of color this JSON file is using. Anyone know how to do this?

1 Answer 1

1

You can use the three.js library to convert base 10 color values to hex:

var c = new THREE.Color( 123456789 ).getHexString();
console.log( '0x' + c  );

Or using Google, simply type

0xff0000 in base 10

or

16711680 in hex

three.js r.74

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.