mmieher Active Member Licensed User Longtime User Jan 7, 2022 #1 Don't want to bother @Johan Schoeman again. He has been so helpful with my project! I don't understand how to get from something like this Code: Copy Colors.ARGB(112,181,214,255) To a color spec like this Code: Copy GLS1.setCubeBackgroundColor(0.1f, 0.1f, 0.0f, 0.0f) 'set the background color of the cube - note that values should be between 0.0f and 0.1f <-- He means 1.0? I have figured out that: Code: Copy GLS1.setFace_1_Color(1.0f, 1.0f, 1.0f, 1.0f) ' Transparent GLS1.setFace_1_Color(0.0f, 0.0f, 0.0f, 0.0f) ' Black Thanks. Ref: https://www.b4x.com/android/forum/threads/3d-spinning-cube.92442/#post-869576
Don't want to bother @Johan Schoeman again. He has been so helpful with my project! I don't understand how to get from something like this Code: Copy Colors.ARGB(112,181,214,255) To a color spec like this Code: Copy GLS1.setCubeBackgroundColor(0.1f, 0.1f, 0.0f, 0.0f) 'set the background color of the cube - note that values should be between 0.0f and 0.1f <-- He means 1.0? I have figured out that: Code: Copy GLS1.setFace_1_Color(1.0f, 1.0f, 1.0f, 1.0f) ' Transparent GLS1.setFace_1_Color(0.0f, 0.0f, 0.0f, 0.0f) ' Black Thanks. Ref: https://www.b4x.com/android/forum/threads/3d-spinning-cube.92442/#post-869576
roumei Active Member Licensed User Jan 8, 2022 #2 You can get the float value by dividing your byte value through 255. Notice the different order (ARGB <> RGBA). Try this: B4X: Copy ' Colors.ARGB(112,181,214,255) ' Order is ARGB gls1.setCubeBackgroundColor(181/255, 214/255, 255/255, 112/255) ' Order is RGBA Upvote 0
You can get the float value by dividing your byte value through 255. Notice the different order (ARGB <> RGBA). Try this: B4X: Copy ' Colors.ARGB(112,181,214,255) ' Order is ARGB gls1.setCubeBackgroundColor(181/255, 214/255, 255/255, 112/255) ' Order is RGBA