Evas filters: Fix color(0xrrggbb) to be opaque by default

For compatibility with previous behaviour and with what the doc
says, make sure default alpha is 255 and not 0.

This way color(0) is black and not transparent
This commit is contained in:
Jean-Philippe Andre 2015-06-30 10:33:29 +09:00
parent 4e6e7def00
commit 6980cb2c70
1 changed files with 2 additions and 1 deletions

View File

@ -147,7 +147,7 @@ __color = {
-- input single value 0xAARRGGBB
if ((B == nil) and (type(A) == 'number')) then
A = math.floor(A) -- % 0x100000000
A = math.floor(A)
if ((A < 0) or (A > 0xFFFFFFFF)) then
error('Invalid color value: ' .. string.format("0x%x", A))
end
@ -155,6 +155,7 @@ __color = {
self.r = math.floor((A / 0x10000) % 0x100)
self.g = math.floor((A / 0x100) % 0x100)
self.b = math.floor(A % 0x100)
if (self.a == 0) then self.a = 255 end
return self
end