X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=basis%2Fwindows%2Ftypes%2Ftypes.factor;fp=basis%2Fwindows%2Ftypes%2Ftypes.factor;h=e6edc14dd178138d577507b777d321b0198647d4;hp=780be34e89f6b34eedcecfac5622a41be4461431;hb=1b09f93777bb30cffc7af9314a51446bf9b06408;hpb=e23bcdef804a1e6a96186b4bc97ad6f144c0846b diff --git a/basis/windows/types/types.factor b/basis/windows/types/types.factor index 780be34e89..e6edc14dd1 100644 --- a/basis/windows/types/types.factor +++ b/basis/windows/types/types.factor @@ -2,7 +2,7 @@ ! 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 @@ -379,9 +379,9 @@ TYPEDEF: DWORD* LPCOLORREF [ -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 ; + >RGB< [ 255 /f ] tri@ 1.0 ; STRUCT: TEXTMETRICW { tmHeight LONG }