diff --git a/docs/api/textures/DataTexture.html b/docs/api/textures/DataTexture.html index f8bbdffd7d0722..ffba85772b4f4e 100644 --- a/docs/api/textures/DataTexture.html +++ b/docs/api/textures/DataTexture.html @@ -32,6 +32,33 @@
+ // create a buffer with color data
+
+ var size = width * height;
+ var data = new Uint8Array( 3 * size );
+
+ var r = Math.floor( color.r * 255 );
+ var g = Math.floor( color.g * 255 );
+ var b = Math.floor( color.b * 255 );
+
+ for ( var i = 0; i < size; i ++ ) {
+
+ var stride = i * 3;
+
+ data[ stride ] = r;
+ data[ stride + 1 ] = g;
+ data[ stride + 2 ] = b;
+
+ }
+
+ // used the buffer to create a [name]
+
+ var texture = new THREE.DataTexture( data, width, height, THREE.RGBFormat );
+
+