Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Using RGBA Colour The Bagpuss Way
Search
Drew McLellan
September 27, 2011
Technology
120
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Using RGBA Colour The Bagpuss Way
From Oxford Geek Night.
Drew McLellan
September 27, 2011
More Decks by Drew McLellan
See All by Drew McLellan
HTML5 APIs PHP Yorkshire 2017
drewm
1
230
HTML5 APIs Confoo Montreal
drewm
1
280
PHP Payments with Omnipay
drewm
0
140
HTML5 APIs Confoo Vancouver
drewm
0
300
Learn to Love Regular Expressions
drewm
0
180
Ecommerce Projects with Moltin
drewm
0
700
Writing Portable PHP
drewm
0
140
Getting to Grips with Regular Expressions
drewm
1
290
Back to Front Performance - Oct 2013
drewm
0
130
Other Decks in Technology
See All in Technology
【GCC2026】鉄拳8でのVFX開発事例
bandainamcostudios
PRO
0
290
Oracle MCP Servers Explained
thatjeffsmith
0
440
AIのためのEthernet技術動向 (SerDes)
markunet
1
310
【書籍出版記念】 10周回って、エージェント開発は RAGがすべてだった。〜RAGの歴史と開発現場で見えた実践知〜
akiratameto
19
6.9k
わたしが知り合いゼロの勉強会に 行けるようになるまで
r5ni4
1
230
AIに持続⼒を与える 判断の⻑期記憶設計
eiei114
1
680
AI時代のアウトプット――変わったこと、変わらないこと / Devsumi 2026 Kansai #devsumi
jnchito
0
530
案件に一番詳しいAIを Amazon Bedrock AgentCore で作る ― 知見が知見を生むチームへ / Compounding Knowledge with AgentCore
yusukeshimizu
1
170
Head First モブプログラミング / Head First Mobprogramming
takaking22
10
12k
フィジカルAIの知識ゼロの僕でも AIを使えばここまでできた
tatsuya1970
0
160
MIXIで活躍できるエンジニアを 若手社員目線で考えてみる
mixi_engineers
PRO
0
140
Kiro WebとCloud Sessions
nagisa53
2
160
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
10k
So, you think you're a good person
axbom
PRO
2
2.1k
KATA
mclloyd
PRO
35
15k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
250
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
GitHub's CSS Performance
jonrohan
1033
470k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
210
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
490
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Scaling GitHub
holman
464
140k
Transcript
Using RGBA Colour The Bagpuss Way Oxford Geek Night 10
- 21 January 2009 Drew McLellan, edgeofmyseat.com
There are lots of different ways to specify colours in
CSS
fuchsia #FF00FF #F0F rgb(255, 0, 255) rgb(100%, 0, 100%)
However you write it, they’re identical colours. (it’s all the
same biscuit)
They all have one other important aspect in common.
These all specify solid colours.
CSS3 introduces rgba()
Red Green Blue Alpha (opacity)
rgba(255, 255, 255, 0.5)
rgba(255, 255, 255, 0.5)
But that’s what CSS3 opacity does isn’t it?
filter:alpha(opacity=50); -moz-opacity: 0.5; opacity: 0.5;
Opacity affects the entire object Hello world Hello world
RGBA is about the opacity of a colour Hello world
Hello world Hello world
Pink stripes 100% opacity
Entire Bagpuss 50% opacity
Pink stripes 50% opacity, as nature intended
Closer to a tiled, flat colour semi-transparent PNG, without the
image.
... but also works for text, borders, foregrounds, backgrounds, playgrounds.
(maybe not playgrounds)
How?
rgba(255, 255, 255, 0.5)
Browser support is ok, but not great.
Firefox 3 Safari 3 Opera 10
So how can we use this today without ending up
with a nasty old mess in rubbish old browsers that don’t support all this lovely RGBA stuff?
None
Fall back to solid colour background: rgb(187, 192, 187); background:
rgba(120, 130, 120, 0.5);
Fall back to alpha PNG background: transparent url(green50.png); background: rgba(120,
130, 120, 0.5) none;
Tell me more! http://allinthehead.com/code/rgba/ http://dorward.me.uk/www/css/alpha-colour/
allinthehead.com/presentations Thank you. twitter.com/drewm