- Sceneform SDK for Android
was open sourced and archived ( github.com/google-ar/sceneform-android-sdk
) with version 1.16.0.
- This site ( developers.google.com/sceneform
) serves as the documentation archive for the previous version, Sceneform SDK for Android
1.15.0.
- Do not use version 1.17.0 of the Sceneform Maven artifacts
.
- The 1.17.1 Maven artifacts can be used. Other than the version, however, the 1.17.1 artifacts are identical to the 1.15.0 artifacts.
Color
Stay organized with collections
Save and categorize content based on your preferences.
An RGBA color. Each component is a value with a range from 0 to 1. Can be created from an Android
ColorInt.
Fields
public
float |
a
|
* |
public
float |
b
|
* |
public
float |
g
|
* |
public
float |
r
|
* |
Public Constructors
* |
Color
() Construct a Color and default it to white (1, 1, 1, 1).
|
* |
Color
( Color
color) Construct a Color with the values of another color.
|
* |
Color
(float r, float g, float b) Construct a color with the RGB values passed in and an alpha of 1.
|
* |
Color
(float r, float g, float b, float a) Construct a color with the RGBA values passed in.
|
* |
Color
(int argb) Construct a color with an integer in the sRGB color space packed as an ARGB value.
|
Public Methods
Color
|
inverseTonemap
() Returns a new color with Sceneform's tonemapping inversed.
|
void |
set
(int argb) Set to RGBA values from an integer in the sRGB color space packed as an ARGB value.
|
void |
set
(float r, float g, float b) Set to the RGB values passed in and an alpha of 1.
|
void |
set
(float r, float g, float b, float a) Set to the RGBA values passed in.
|
void |
set
( Color
color) Set to the values of another color.
|
Inherited Methods
From class
java.lang.Object
Public Constructors
public
Color
()
Construct a Color and default it to white (1, 1, 1, 1).
public
Color
( Color
color)
Construct a Color with the values of another color.
public
Color
(float r, float g, float b)
Construct a color with the RGB values passed in and an alpha of 1.
public
Color
(float r, float g, float b, float a)
Construct a color with the RGBA values passed in.
public
Color
(int argb)
Construct a color with an integer in the sRGB color space packed as an ARGB value. Used for
constructing from an Android ColorInt.
Public Methods
public Color
inverseTonemap
()
Returns a new color with Sceneform's tonemapping inversed.
public
void
set
(int argb)
Set to RGBA values from an integer in the sRGB color space packed as an ARGB value. Used for
setting from an Android ColorInt.
public
void
set
(float r, float g, float b)
Set to the RGB values passed in and an alpha of 1.
public
void
set
(float r, float g, float b, float a)
Set to the RGBA values passed in.
public
void
set
( Color
color)
Set to the values of another color.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eColor\u003c/code\u003e represents an RGBA color with components ranging from 0 to 1.\u003c/p\u003e\n"],["\u003cp\u003eIt can be constructed from individual RGBA values, another \u003ccode\u003eColor\u003c/code\u003e object, or an Android ColorInt.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eColor\u003c/code\u003e provides methods to set its values and to invert Sceneform's tonemapping.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ea\u003c/code\u003e, \u003ccode\u003eb\u003c/code\u003e, \u003ccode\u003eg\u003c/code\u003e, and \u003ccode\u003er\u003c/code\u003e fields represent the alpha, blue, green, and red components of the color, respectively.\u003c/p\u003e\n"]]],["The `Color` class defines an RGBA color with components ranging from 0 to 1. It includes fields `a`, `b`, `g`, and `r` representing alpha, blue, green, and red. Constructors initialize colors from default white, another `Color` object, RGB values, RGBA values, or an Android ColorInt. Methods enable setting color values from similar inputs, including setting the RGB with an alpha of 1. `inverseTonemap` creates a new color with inverse tonemapping.\n"],null,["# Color\n\npublic class **Color** \nAn RGBA color. Each component is a value with a range from 0 to 1. Can be created from an Android\nColorInt. \n\n### Fields\n\n|--------------|---------------------------------------------------------------------|---|\n| public float | [a](/sceneform/reference/com/google/ar/sceneform/rendering/Color#a) | |\n| public float | [b](/sceneform/reference/com/google/ar/sceneform/rendering/Color#b) | |\n| public float | [g](/sceneform/reference/com/google/ar/sceneform/rendering/Color#g) | |\n| public float | [r](/sceneform/reference/com/google/ar/sceneform/rendering/Color#r) | |\n\n### Public Constructors\n\n|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color#Color())() Construct a Color and default it to white (1, 1, 1, 1). |\n| | [Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color#Color(com.google.ar.sceneform.rendering.Color))([Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color) color) Construct a Color with the values of another color. |\n| | [Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color#Color(float,%20float,%20float))(float r, float g, float b) Construct a color with the RGB values passed in and an alpha of 1. |\n| | [Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color#Color(float,%20float,%20float,%20float))(float r, float g, float b, float a) Construct a color with the RGBA values passed in. |\n| | [Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color#Color(int))(int argb) Construct a color with an integer in the sRGB color space packed as an ARGB value. |\n\n### Public Methods\n\n|-----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color) | [inverseTonemap](/sceneform/reference/com/google/ar/sceneform/rendering/Color#inverseTonemap())() Returns a new color with Sceneform's tonemapping inversed. |\n| void | [set](/sceneform/reference/com/google/ar/sceneform/rendering/Color#set(int))(int argb) Set to RGBA values from an integer in the sRGB color space packed as an ARGB value. |\n| void | [set](/sceneform/reference/com/google/ar/sceneform/rendering/Color#set(float,%20float,%20float))(float r, float g, float b) Set to the RGB values passed in and an alpha of 1. |\n| void | [set](/sceneform/reference/com/google/ar/sceneform/rendering/Color#set(float,%20float,%20float,%20float))(float r, float g, float b, float a) Set to the RGBA values passed in. |\n| void | [set](/sceneform/reference/com/google/ar/sceneform/rendering/Color#set(com.google.ar.sceneform.rendering.Color))([Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color) color) Set to the values of another color. |\n\n### Inherited Methods\n\nFrom class java.lang.Object \n\n|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [Object](https://developer.android.com/reference/java/lang/Object) | clone() |\n| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object) arg0) |\n| void | finalize() |\n| final [Class](https://developer.android.com/reference/java/lang/Class)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](https://developer.android.com/reference/java/lang/String) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFields\n------\n\n#### public float\n**a**\n\n\u003cbr /\u003e\n\n#### public float\n**b**\n\n\u003cbr /\u003e\n\n#### public float\n**g**\n\n\u003cbr /\u003e\n\n#### public float\n**r**\n\n\u003cbr /\u003e\n\nPublic Constructors\n-------------------\n\n#### public\n**Color**\n()\n\nConstruct a Color and default it to white (1, 1, 1, 1). \n\n#### public\n**Color**\n([Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color) color)\n\nConstruct a Color with the values of another color. \n\n##### Parameters\n\n| color | |\n|-------|---|\n\n#### public\n**Color**\n(float r, float g, float b)\n\nConstruct a color with the RGB values passed in and an alpha of 1. \n\n##### Parameters\n\n| r | |\n| g | |\n| b | |\n|---|---|\n\n#### public\n**Color**\n(float r, float g, float b, float a)\n\nConstruct a color with the RGBA values passed in. \n\n##### Parameters\n\n| r | |\n| g | |\n| b | |\n| a | |\n|---|---|\n\n#### public\n**Color**\n(int argb)\n\nConstruct a color with an integer in the sRGB color space packed as an ARGB value. Used for\nconstructing from an Android ColorInt. \n\n##### Parameters\n\n| argb | |\n|------|---|\n\nPublic Methods\n--------------\n\n#### public [Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color)\n**inverseTonemap**\n()\n\nReturns a new color with Sceneform's tonemapping inversed. \n\n#### public void\n**set**\n(int argb)\n\nSet to RGBA values from an integer in the sRGB color space packed as an ARGB value. Used for\nsetting from an Android ColorInt. \n\n##### Parameters\n\n| argb | |\n|------|---|\n\n#### public void\n**set**\n(float r, float g, float b)\n\nSet to the RGB values passed in and an alpha of 1. \n\n##### Parameters\n\n| r | |\n| g | |\n| b | |\n|---|---|\n\n#### public void\n**set**\n(float r, float g, float b, float a)\n\nSet to the RGBA values passed in. \n\n##### Parameters\n\n| r | |\n| g | |\n| b | |\n| a | |\n|---|---|\n\n#### public void\n**set**\n([Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color) color)\n\nSet to the values of another color. \n\n##### Parameters\n\n| color | |\n|-------|---|"]]