]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/google/charts/charts.factor
colors: merge colors.constants and colors.hex.
[factor.git] / extra / google / charts / charts.factor
index 28d40b82404641776879236c9bc8eed77575bd16..038c114666578a78654e729109572de324354204 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2011 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 
-USING: accessors arrays assocs colors.hex combinators formatting
+USING: accessors arrays assocs combinators formatting
 http.client images.http images.loader images.loader.private
 images.viewer kernel math math.order present sequences splitting
 urls ;
@@ -70,6 +70,10 @@ PRIVATE>
 
 <PRIVATE
 
+: rgba>hex ( rgba -- hex )
+    [ red>> ] [ green>> ] [ blue>> ] tri
+    [ 255 * >integer ] tri@ "%02X%02X%02X" sprintf ;
+
 : chart>url ( chart -- url )
     [ URL" http://chart.googleapis.com/chart" clone ] dip {
         [ type>> "cht" set-query-param ]