diff options
author | Joris | 2016-10-03 20:24:59 +0200 |
---|---|---|
committer | Joris | 2016-10-03 20:24:59 +0200 |
commit | 2a11b28d2ee636eb730dbb5767104aeac9936afa (patch) | |
tree | c7261376073d9334007d24fbe67acda6e11943fa /src/View.elm | |
parent | c79aae101926d3e5a123b707dd1324dca50994b7 (diff) | |
parent | 3a1cbfe23a3d06c3c30828c623a089868cff0670 (diff) |
Merge branch 'master' into demo
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) |