NetSurf
Macros
css.h File Reference

Netsurf core css API. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define nscss_color_to_ns(c)
 Convert a CSS color to a NetSurf colour primitive. More...
 
#define ns_color_to_nscss(c)
 Convert a NetSurf color to a CSS colour primitive. More...
 
#define nscss_color_is_transparent(color)    (((color) >> 24) == 0)
 Determine if a CSS color primitive is transparent. More...
 

Detailed Description

Netsurf core css API.

Definition in file css.h.

Macro Definition Documentation

◆ ns_color_to_nscss

#define ns_color_to_nscss (   c)
Value:
( ((~c) & 0xff000000) | \
((( c) & 0xff0000 ) >> 16) | \
(( c) & 0xff00 ) | \
((( c) & 0xff ) << 16))

Convert a NetSurf color to a CSS colour primitive.

(1-A)BGR -> ARGB

Parameters
cThe NetSurf color to convert
Returns
Corresponding CSS colour primitive

Definition at line 50 of file css.h.

◆ nscss_color_is_transparent

#define nscss_color_is_transparent (   color)     (((color) >> 24) == 0)

Determine if a CSS color primitive is transparent.

Parameters
colorThe CSS color to consider
Returns
True if the color is transparent, false otherwise

Definition at line 62 of file css.h.

◆ nscss_color_to_ns

#define nscss_color_to_ns (   c)
Value:
( ((~c) & 0xff000000) | \
((( c) & 0xff0000 ) >> 16) | \
(( c) & 0xff00 ) | \
((( c) & 0xff ) << 16))

Convert a CSS color to a NetSurf colour primitive.

ARGB -> (1-A)BGR

Parameters
cThe CSS color to convert
Returns
Corresponding NetSurf colour primitive

Definition at line 35 of file css.h.