diff options
Diffstat (limited to 'src/View.elm')
-rw-r--r-- | src/View.elm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/View.elm b/src/View.elm index 822c2d2..d6265f6 100644 --- a/src/View.elm +++ b/src/View.elm @@ -6,6 +6,7 @@ import Html exposing (Html) import Svg exposing (..) import Svg.Attributes exposing (..) import List +import Color as Color exposing (Color) import Time exposing (Time) @@ -16,7 +17,6 @@ import Model.Point exposing (..) import Model.Config exposing (..) import Model.Round exposing (..) import Model.Level exposing (..) -import Model.Color exposing (htmlOutput) import View.Round exposing (roundView) @@ -103,10 +103,15 @@ renderBoard currentScore = [ y (toString headerHeight) , width "100%" , height "100%" - , fill (htmlOutput (progressiveColor currentScore)) + , fill (colorRgba (progressiveColor currentScore)) ] [] +colorRgba : Color -> String +colorRgba color = + let c = Color.toRgb color + in "rgba(" ++ (toString c.red) ++ ", " ++ (toString c.green) ++ ", " ++ (toString c.blue) ++ "," ++ (toString c.alpha) ++ ")" + renderPlayer : Vec2 -> Player -> Float -> Svg msg renderPlayer boardSize player playerSize = renderCircle boardSize player.pos playerSize (playerColor player.config) |