Go back to Efl.Gfx.Filter.

Colors

Many filter operations will take one (or more) color arguments.
Since EFL 1.15, the supported syntax to create colors has expanded using Lua class appropriately named color.

The color values used in Efl.Gfx.Filter are not premultiplied and range from 0 to 255.
If alpha is not specified or 0 (in the form '#rgba'), then the color will be opaque (i.e. alpha = 255), unless the color is invisible or '#0000'.
Syntax
-- default is black
color()
color(nil)
 
-- with r,g,b,a integers in the range [0-255]
color(r,g,b)
color(r,g,b,a)
color({r = 0, g = 255, b = 128, a = 64})
 
-- with r,g,b,a hexadecimal values [0-F]
color('#rgb')
color('#rgba')
color('#rrggbb')
color('#rrggbbaa')
 
-- predefined colors
color('red')
Predefined colors

Here is the list of predefined colors, based on their equivalent HTML names.

Name Value Example
'white' '#FFFFFF'
'black' '#000000'
'red' '#FF0000'
'green' '#008000'
'blue' '#0000FF'
'darkblue' '#0000A0'
'yellow' '#FFFF00'
'magenta' '#FF00FF'
'cyan' '#00FFFF'
'orange' '#FFA500'
'purple' '#800080'
'brown' '#A52A2A'
'maroon' '#800000'
'lime' '#00FF00'
'gray'
'grey'
'#808080'
'silver' '#C0C0C0'
'olive' '#808000'
'invisible'
'transparent'
'#0000'
Usage examples
blur { 15, color = color('yellow') }
blur { 5, color = '#f0f8' }
blur { 2, color = state.color }
blend { color = 'white' }