Public Group

# Alpha value?

This topic is 4812 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

What exactly is an alpha value, and what is it for? Is it really important?

##### Share on other sites
Alpha is important if you want to work with transparency. As always, Wikipedia to the rescue.

##### Share on other sites
Alpha [in graphical use] is a measure of opaqueness.

Yes, it's fairly important to understand, if not so important to actually use.

##### Share on other sites
I see. Thanks. ^_^

##### Share on other sites
Bear in mind that while the alpha value has historically meant 'opacity,' it's frequently abused into meaning other things - like reflectivity or brightness. At the end of the day it's just a number, and if you feed it to the parts of the system that deal with reflectivity or brightness instead of the parts of the system that deal with opacity, nothing will go "Hey, what? That's an alpha value dude, get it away from me."

##### Share on other sites
Here is some java applet I did a while ago that uses it, so you can see it in action if you want to compile it etc.

import javax.swing.*;import java.awt.*;public class BallApplet extends JApplet{    BallThread b[] = new BallThread[20];    Color array[] = new Color[20];        public BouncingBallApplet(){        for(int x=0; x < b.length; ++x){            array[x] = new Color((int)(Math.random()*250),(int)(Math.random()*255),(int)(Math.random()*255),(int)(Math.random()*255));            b[x] = new BallThread((int)(Math.random()*800),(int)(Math.random()*60));            b[x].start();        }        this.setSize(800,600);                  }        public void paint(Graphics g){        g.setColor(array[(int)(Math.random()*array.length)]);        g.fillOval(b[(int)(Math.random()*20)].xLoc,b[(int)(Math.random()*20)].yLoc,40,40);        this.repaint(40);    }        public static void main(String args[]){        new BallApplet();    }    public class BallThread extends Thread{        private int xLoc;        private int yLoc;                                public BallThread(int x, int y){            xLoc = x;            yLoc = y;        }                public void run(){            for(;;){                xLoc = (int)(Math.random()*800);                yLoc = (int)(Math.random()*600);                                try{                    this.sleep((long)(Math.random()*200));                }catch(InterruptedException e){                    System.out.println(e.toString());                }                            }        }    }}

1. 1
Rutin
38
2. 2
3. 3
4. 4
5. 5

• 12
• 15
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633354
• Total Posts
3011494
• ### Who's Online (See full list)

There are no registered users currently online

×