How to use the color.b function in color

To help you get started, we’ve selected a few color examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xeolabs / scenejs / examples / postprocessing_fog.html View on Github external
var Menu = function () {

                    this.start = myFog.getStart();
                    this.end = myFog.getEnd();
                    this.density = myFog.getDensity();
                    this.mode = myFog.getMode();

                    var color = myFog.getColor();

                    this["color.r"] = color.r;
                    this["color.g"] = color.g;
                    this["color.b"] = color.b;

                    var self = this;

                    // This is actually quite inefficient because it continually updates
                    // the scene graph, forcing frames to continually re-render.
                    // Your GPU's not going to like it, but it's just for a quick and dirty demo.
                    var update = function () {

                        myFog.setStart(self.start);
                        myFog.setEnd(self.end);
                        myFog.setDensity(self.density);
                        myFog.setMode(self.mode);
                        myFog.setColor({
                            r:self["color.r"],
                            g:self["color.g"],
                            b:self["color.b"]
github xeolabs / scenejs / api / latest / extras / gui.js View on Github external
var update = function () {
                material.set({
                    color:{
                        r:self["color.r"],
                        g:self["color.g"],
                        b:self["color.b"]
                    },
                    specularColor:{
                        r:self["specularColor.r"],
                        g:self["specularColor.g"],
                        b:self["specularColor.b"]
                    },
                    specular:self.specular,
                    shine:self.shine,
                    emit:self.emit,
                    alpha:self.alpha
                });
                requestAnimationFrame(update);
            };
            update();
github xeolabs / scenejs / examples / libs / gui / gui.js View on Github external
var update = function () {

                material.setColor({
                    r: self["color.r"],
                    g: self["color.g"],
                    b: self["color.b"]
                });
                material.setSpecularColor({
                    r: self["specularColor.r"],
                    g: self["specularColor.g"],
                    b: self["specularColor.b"]
                });
                material.setSpecular(self.specular);
                material.setShine(self.shine);
                material.setEmit(self.emit);
                material.setAlpha(self.alpha);

                requestAnimationFrame(update);
            };
            update();
github xeolabs / scenejs / examples / lighting_directional_view.html View on Github external
var update = function () {

                        myLights.setLights({
                            "0":{
                                dir:{
                                    x:self["dir.x"],
                                    y:self["dir.y"],
                                    z:self["dir.z"]
                                },

                                color:{
                                    r:self["color.r"],
                                    g:self["color.g"],
                                    b:self["color.b"]
                                },
                                specular:self.specular,
                                diffuse:self.diffuse
                            }
                        });

                        requestAnimationFrame(update);
                    };
github xeolabs / scenejs / src / extras / gui / gui.js View on Github external
var Menu = function () {
            this["pos.x"] = 10.0;
            this["pos.y"] = 10.0;
            this["pos.z"] = 10.0;
            this["color.r"] = 1.0;
            this["color.g"] = 1.0;
            this["color.b"] = 1.0;
            this.constantAttenuation = 0.0;
            this.linearAttenuation = 0.0;
            this.quadraticAttenuation = 0.0;
            this.specular = true;
            this.diffuse = true;

            var self = this;

            var update = function () {
                lights.setLights({
                    "0":{
                        pos:{
                            x:self["pos.x"],
                            y:self["pos.y"],
                            z:self["pos.z"]
                        },
github xeolabs / scenejs / examples / libs / gui / gui.js View on Github external
var Menu = function () {
            this["color.r"] = 1.0;
            this["color.g"] = 1.0;
            this["color.b"] = 1.0;
            this["specularColor.r"] = 1.0;
            this["specularColor.g"] = 1.0;
            this["specularColor.b"] = 1.0;
            this.specular = 1.0;
            this.shine = 70.0;
            this.emit = 0;
            this.alpha = 1.0;

            var self = this;

            var update = function () {

                material.setColor({
                    r: self["color.r"],
                    g: self["color.g"],
                    b: self["color.b"]
github xeolabs / scenejs / examplesold / pages / lights / directionalView.html View on Github external
var update = function () {

                        myLights.setLights({
                            "0":{
                                dir:{
                                    x:self["dir.x"],
                                    y:self["dir.y"],
                                    z:self["dir.z"]
                                },

                                color:{
                                    r:self["color.r"],
                                    g:self["color.g"],
                                    b:self["color.b"]
                                },
                                specular:self.specular,
                                diffuse:self.diffuse
                            }
                        });

                        requestAnimationFrame(update);
                    };
github xeolabs / scenejs / examples / postprocessing_fog.html View on Github external
var update = function () {

                        myFog.setStart(self.start);
                        myFog.setEnd(self.end);
                        myFog.setDensity(self.density);
                        myFog.setMode(self.mode);
                        myFog.setColor({
                            r:self["color.r"],
                            g:self["color.g"],
                            b:self["color.b"]
                        });

                        requestAnimationFrame(update);
                    };
github xeolabs / scenejs / examples / shaders_fog.html View on Github external
var update = function () {

                        myFog.setStart(self.start);
                        myFog.setEnd(self.end);
                        myFog.setDensity(self.density);
                        myFog.setMode(self.mode);
                        myFog.setColor({
                            r: self["color.r"],
                            g: self["color.g"],
                            b: self["color.b"]
                        });

                        requestAnimationFrame(update);
                    };
github xeolabs / scenejs / src / extras / gui / gui.js View on Github external
var update = function () {
                material.set({
                    color:{
                        r:self["color.r"],
                        g:self["color.g"],
                        b:self["color.b"]
                    },
                    specularColor:{
                        r:self["specularColor.r"],
                        g:self["specularColor.g"],
                        b:self["specularColor.b"]
                    },
                    specular:self.specular,
                    shine:self.shine,
                    emit:self.emit,
                    alpha:self.alpha
                });
                requestAnimationFrame(update);
            };
            update();