Paste: hex color

Author: mrjbq7
Mode: factor
Date: Tue, 19 Oct 2010 23:39:46
Plain Text |
: hex-color ( str -- color )
    hex>
    [ HEX: ff0000 bitand -16 shift ]
    [ HEX: 00ff00 bitand -8 shift ]
    [ HEX: 0000ff bitand ] tri 1.0 <rgba> ;

SYNTAX: COLOR# scan hex-color suffix! ;

! Examples:
!   COLOR# 336699
!   COLOR# ffffff

New Annotation

Summary:
Author:
Mode:
Body: