diff options
| author | Akshay Nair <phenax5@gmail.com> | 2024-12-14 20:07:41 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2024-12-14 20:45:54 +0530 |
| commit | 34907bc25dba055dfbfe91d9a91803cc75283bfa (patch) | |
| tree | 310ed24c944b073f558ce6c67e3352fe0ad19d1d /src/Chelleport/Draw.hs | |
| parent | 73564537897f7573690955596097085b711c92e5 (diff) | |
| download | chelleport-34907bc25dba055dfbfe91d9a91803cc75283bfa.tar.gz chelleport-34907bc25dba055dfbfe91d9a91803cc75283bfa.zip | |
Refactor view + add better highlighting of regions
Diffstat (limited to 'src/Chelleport/Draw.hs')
| -rw-r--r-- | src/Chelleport/Draw.hs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Chelleport/Draw.hs b/src/Chelleport/Draw.hs index 6375997..fff5d0d 100644 --- a/src/Chelleport/Draw.hs +++ b/src/Chelleport/Draw.hs @@ -1,6 +1,6 @@ module Chelleport.Draw where -import Chelleport.Context (DrawContext (ctxFont, ctxRenderer, ctxWindow)) +import Chelleport.Types import Data.Text (Text) import Data.Word (Word8) import Foreign.C (CInt) @@ -13,6 +13,12 @@ colorWhite = SDL.V4 255 255 255 255 colorLightGray :: SDL.V4 Word8 colorLightGray = SDL.V4 100 100 100 255 +colorGray :: SDL.V4 Word8 +colorGray = SDL.V4 55 52 65 200 + +colorAccent :: SDL.V4 Word8 +colorAccent = SDL.V4 110 112 247 255 + colorGridLines :: SDL.V4 Word8 colorGridLines = SDL.V4 127 29 29 150 @@ -22,8 +28,8 @@ colorAxisLines = SDL.V4 239 68 68 255 colorBackground :: SDL.V4 Word8 colorBackground = SDL.V4 15 12 25 0 -renderText :: DrawContext -> SDL.V2 CInt -> SDL.V4 Word8 -> Text -> IO (CInt, CInt) -renderText ctx position color text = do +drawText :: DrawContext -> SDL.V2 CInt -> SDL.V4 Word8 -> Text -> IO (CInt, CInt) +drawText ctx position color text = do surface <- TTF.blended (ctxFont ctx) color text texture <- SDL.createTextureFromSurface (ctxRenderer ctx) surface SDL.freeSurface surface |
