aboutsummaryrefslogtreecommitdiff
path: root/src/library_sdl.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r--src/library_sdl.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index fcc7e5b9..93bf133b 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -175,15 +175,15 @@ mergeInto(LibraryManager.library, {
// Load SDL color into a CSS-style color specification
loadColorToCSS: function(color) {
var rgba = {{{ makeGetValue('color', '0', 'i32') }}};
- return 'rgb(' + (rgba&255) + ',' + ((rgba >> 8)&255) + ',' + ((rgba >> 16)&255) + ')';
+ return 'rgba(' + (rgba&255) + ',' + ((rgba >> 8)&255) + ',' + ((rgba >> 16)&255) + ',' + (1-((rgba >> 24)&255)/255) + ')';
},
translateColorToCSS: function(rgba) {
- return 'rgb(' + ((rgba >> 24)&255) + ',' + ((rgba >> 16)&255) + ',' + ((rgba >> 8)&255) + ')';
+ return 'rgba(' + ((rgba >> 24)&255) + ',' + ((rgba >> 16)&255) + ',' + ((rgba >> 8)&255) + ',' + (1-(rgba&255)/255) + ')';
},
translateRGBAToCSS: function(r, g, b, a) {
- return 'rgb(' + r + ',' + g + ',' + b + ')';
+ return 'rgba(' + r + ',' + g + ',' + b + ',' + (1-a/255) + ')';
},
makeSurface: function(width, height, flags, usePageCanvas, source) {