! See http://factorcode.org/license.txt for BSD license.
USING: alien.c-types alien.syntax classes.struct colors
io.encodings.utf16n io.encodings.utf8 kernel math math.bitwise
-math.vectors sequences ;
+math.functions math.vectors sequences ;
FROM: alien.c-types => float short ;
IN: windows.types
[ -16 shift 0xff bitand ] tri ;
: color>RGB ( color -- COLORREF )
- >rgba-components drop [ 255 * >integer ] tri@ RGB ;
+ >rgba-components drop [ 255 round * >integer ] tri@ RGB ;
: RGB>color ( COLORREF -- color )
- >RGB< [ 1/255. * >float ] tri@ 1.0 <rgba> ;
+ >RGB< [ 255 /f ] tri@ 1.0 <rgba> ;
STRUCT: TEXTMETRICW
{ tmHeight LONG }