0

After reading this link, I know how to lighten the opacity of a color.

But is there any method to darken the color's opacity?

Community
  • 1
  • 1
rahul saini
  • 51
  • 1
  • 7

2 Answers2

3

If by "darken opacity" you mean moving from a clear blue to a dark blue, and if your question concern HTML/CSS (and not Android like your link suppose) you could use HSL Colors instead of using RGB.

Here is a link where you can find out how tu use CSS colors : http://www.w3schools.com/cssref/css_colors_legal.asp

    /** This is CSS **/
    #light {background-color:hsl(120,100%,25%);}
    #normal {background-color:hsl(120,100%,50%);}
    #dark {background-color:hsl(120,100%,75%);}
    /** 3rd value reprensent black value **/

But if you just mean make your color more/less opaque, you could just use Alpha (Available in RGBA in CSS for example)

You can find out how to use RGBA in the 1st link to!

    /** This is CSS **/
    #opaque {background-color:rgba(0,255,0,1);}
    #transparant {background-color:rgba(0,255,0,0.5);}
    /** The 4th value reprensent alpha/opacity and goes from 0 (transparant) to 1 (opaque)

Hope it helped you

Humbertda
  • 364
  • 1
  • 6
  • 23
0

The way to darken a particular colour is to keep the RBG ratios the same but just lower the numbers, if you look at RBG for black its 0,0,0 so by being closer to 0 you get a darker colour.

Hope that sheds a bit of light on how RBG colour system works.

Joe Lloyd
  • 19,471
  • 7
  • 53
  • 81