]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/types/types.factor
reset frame inset when windows dwm is toggled off and on, and use the system dialog...
[factor.git] / basis / windows / types / types.factor
index 6275f2d3c95a9007e43b1b358e099a25b71a0a15..f3455fbb0f830802c1ada71885a8c9a0a7f84f8a 100755 (executable)
@@ -378,9 +378,15 @@ TYPEDEF: DWORD* LPCOLORREF
 
 : RGB ( r g b -- COLORREF )
     { 16 8 0 } bitfield ; inline
+: >RGB< ( COLORREF -- r g b )
+    [           HEX: ff bitand ]
+    [  -8 shift HEX: ff bitand ]
+    [ -16 shift HEX: ff bitand ] tri ;
 
 : color>RGB ( color -- COLORREF )
     >rgba-components drop [ 255 * >integer ] tri@ RGB ;
+: RGB>color ( COLORREF -- color )
+    >RGB< [ 1/255. * >float ] tri@ 1.0 <rgba> ;
 
 STRUCT: TEXTMETRICW
     { tmHeight LONG }