-----------------------------------------------------------------------------
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
module THREE.Fog
  ( -- * Types
    Fog (..)
    -- * Methods
  , THREE.Fog.new
    -- * Properties
  , isFog
  , name
  , color
  , near
  , far
  ) where
-----------------------------------------------------------------------------
import           Miso
-----------------------------------------------------------------------------
import           THREE.Color
import           THREE.Internal as THREE
-----------------------------------------------------------------------------
-- | https://threejs.org/docs/#api/en/scenes/Fog
newtype Fog
  = Fog
  { Fog -> JSVal
unFog :: JSVal
  } deriving newtype (Fog -> IO [JSVal]
(Fog -> IO [JSVal]) -> ToArgs Fog
forall args. (args -> IO [JSVal]) -> ToArgs args
$ctoArgs :: Fog -> IO [JSVal]
toArgs :: Fog -> IO [JSVal]
ToArgs, Fog -> IO Object
(Fog -> IO Object) -> ToObject Fog
forall a. (a -> IO Object) -> ToObject a
$ctoObject :: Fog -> IO Object
toObject :: Fog -> IO Object
ToObject, Fog -> IO JSVal
(Fog -> IO JSVal) -> ToJSVal Fog
forall a. (a -> IO JSVal) -> ToJSVal a
$ctoJSVal :: Fog -> IO JSVal
toJSVal :: Fog -> IO JSVal
ToJSVal)
-----------------------------------------------------------------------------
instance FromJSVal Fog where
  fromJSVal :: JSVal -> IO (Maybe Fog)
fromJSVal = Maybe Fog -> IO (Maybe Fog)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Maybe Fog -> IO (Maybe Fog))
-> (JSVal -> Maybe Fog) -> JSVal -> IO (Maybe Fog)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Fog -> Maybe Fog
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Fog -> Maybe Fog) -> (JSVal -> Fog) -> JSVal -> Maybe Fog
forall b c a. (b -> c) -> (a -> b) -> a -> c
. JSVal -> Fog
Fog
-----------------------------------------------------------------------------
class FogNewParams a
instance FogNewParams Int
instance FogNewParams (Int, Double)
instance FogNewParams (Int, Double, Double)
new :: (FogNewParams a, ToArgs a) => a -> THREE.Three Fog
new :: forall a. (FogNewParams a, ToArgs a) => a -> IO Fog
new = (JSVal -> Fog) -> MisoString -> a -> IO Fog
forall args con.
ToArgs args =>
(JSVal -> con) -> MisoString -> args -> Three con
THREE.new JSVal -> Fog
Fog MisoString
"Fog"
-----------------------------------------------------------------------------

isFog :: ReadOnly Fog Bool
isFog :: ReadOnly Fog Bool
isFog = MisoString -> ReadOnly Fog Bool
forall object return.
(FromJSVal return, ToObject object) =>
MisoString -> ReadOnly object return
readonly MisoString
"isFog" 

name :: Property Fog MisoString
name :: Property Fog MisoString
name = MisoString -> Property Fog MisoString
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"name"

color :: Property Fog Color
color :: Property Fog Color
color = MisoString -> Property Fog Color
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"color" 

near :: Property Fog Double
near :: Property Fog Double
near = MisoString -> Property Fog Double
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"near" 

far :: Property Fog Double
far :: Property Fog Double
far = MisoString -> Property Fog Double
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"far" 

-----------------------------------------------------------------------------