Class: EnfEditor::EEMaterialColor
- Inherits:
-
Object
- Object
- EnfEditor::EEMaterialColor
- Defined in:
- lib/enfeditor/core_ext/color_utils.rb,
ext/enfhandler/EnfHandler_wrap2.cxx
Overview
Proxy of C++ EnfEditor::EEMaterialColor class
Instance Method Summary collapse
-
#alpha ⇒ Array<Float>
- alpha
-
Float array.
-
#color_type ⇒ Symbol
Color_type.
-
#equal_material_color?(other) ⇒ Boolean
Returns true if #color_type is same and difference of each Float values are less than zero tolerance (1.0e-12).
-
#equal_material_color_alpha?(other) ⇒ Boolean
Returns true if #color_type is :alpha or :rgba and difference of alpha values are less than zero tolerance (1.0e-12).
-
#equal_rgb_color?(other) ⇒ Boolean
Returns true if #color_type is :rgb or :rgba and difference of r,g,b values are less than zero tolerance (1.0e-12).
-
#initialize(color_type, value_array) ⇒ EEMaterialColor
constructor
Create material color.
-
#material_rgba ⇒ Array<Float>
- ambient-r, ambient-g, ambient-b, ambient-a, diffuse-r, diffuse-g, diffuse-b, diffuse-a, specular-r, specular-g, specular-b, specular-a, emission-r, emission-g, emission-b, emission-a, shininess
-
Float array.
-
#material_strength ⇒ Array<Float>
- r, g, b, a, ambient, diffuse, specular, emission, shininess
-
Float array.
-
#rgb ⇒ Array<Float>
- r,g,b
-
Float array.
-
#rgba ⇒ Array<Float>
- r,g,b,a
-
Float array.
-
#to_alpha ⇒ Float
Returns color value as alpha.
-
#to_rgb ⇒ Array<Float>
Returns color value array as rgb.
-
#to_rgba ⇒ Array<Float>
Returns color value array as rgba.
Constructor Details
#initialize(color_type, value_array) ⇒ EEMaterialColor
See also #alpha, #rgb, #rgba, #material_strength and #material_rgba methods for value_array contents.
Create material color
91 |
# File 'lib/enfeditor/core_ext/color_utils.rb', line 91 'c_defined'.to_s |
Instance Method Details
#alpha ⇒ Array<Float>
This API raises error if #color_type is not :alpha. 0.0 is transparent, while 1.0 is opaque.
Returns [alpha] Float array. Array size is 1. Each Float value range is from 0.0 to 1.0.
#color_type ⇒ Symbol
Returns color_type. Valid types are :alpha, :rgb, :rgba, :material_strength and :material_rgba.
#equal_material_color?(other) ⇒ Boolean
This API can be called for all #color_type.
Returns true if #color_type is same and difference of each Float values are less than zero tolerance (1.0e-12).
#equal_material_color_alpha?(other) ⇒ Boolean
Returns true if #color_type is :alpha or :rgba and difference of alpha values are less than zero tolerance (1.0e-12).
#equal_rgb_color?(other) ⇒ Boolean
Returns true if #color_type is :rgb or :rgba and difference of r,g,b values are less than zero tolerance (1.0e-12).
#material_rgba ⇒ Array<Float>
This API raises error if #color_type is not :material_rgba.
Returns [ambient-r, ambient-g, ambient-b, ambient-a, diffuse-r, diffuse-g, diffuse-b, diffuse-a, specular-r, specular-g, specular-b, specular-a, emission-r, emission-g, emission-b, emission-a, shininess] Float array. Array size is 17. Each Float value range is from 0.0 to 128.0 for shininess and from 0.0 to 1.0 for the others.
#material_strength ⇒ Array<Float>
This API raises error if #color_type is not :material_strength.
Returns [r, g, b, a, ambient, diffuse, specular, emission, shininess] Float array. Array size is 9. Each Float value range is from 0.0 to 128.0 for shininess and from 0.0 to 1.0 for the others.
#rgb ⇒ Array<Float>
This API raises error if #color_type is not :rgb.
Returns [r,g,b] Float array. Array size is 3. Each Float value range is from 0.0 to 1.0.
#rgba ⇒ Array<Float>
This API raises error if #color_type is not :rgba.
Returns [r,g,b,a] Float array. Array size is 4. Each Float value range is from 0.0 to 1.0.
#to_alpha ⇒ Float
This API can be called for all #color_type.
Returns color value as alpha.
#to_rgb ⇒ Array<Float>
This API can be called for all #color_type except :alpha.
Returns color value array as rgb.
#to_rgba ⇒ Array<Float>
This API can be called for all #color_type except :alpha.
Returns color value array as rgba.