packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/GPUColorDict.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webgpu (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.GPUColorDict
       (js_newGPUColorDict, js_setR, js_getR, js_setG, js_getG, js_setB, js_getB, js_setA, js_getA, newGPUColorDict, setR, getR, setG, getG, setB, getB, setA, getA, GPUColorDict(..), gTypeGPUColorDict)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(($1, $2, $3, $4) => { return ({\"r\": $1, \"g\": $2, \"b\": $3, \"a\": $4}); })"
        js_newGPUColorDict :: Double -> Double -> Double -> Double -> IO GPUColorDict
-- | <https://gpuweb.github.io/gpuweb/#dictdef-gpucolordict GPUColorDict specification>
newGPUColorDict :: (MonadDOM m) => Double -> Double -> Double -> Double -> m GPUColorDict
newGPUColorDict r g b a = liftDOM ((js_newGPUColorDict (r) (g) (b) (a)))

foreign import javascript safe "(($1, $2) => { $1[\"r\"] = $2; })"
        js_setR :: GPUColorDict -> Double -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucolordict-r GPUColorDict.r specification>
setR :: (MonadDOM m) => GPUColorDict -> Double -> m ()
setR self val = liftDOM (void ((js_setR (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"r\"]; })"
        js_getR :: GPUColorDict -> IO Double
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucolordict-r GPUColorDict.r specification>
getR :: (MonadDOM m) => GPUColorDict -> m Double
getR self = liftDOM ((js_getR (self)))

foreign import javascript safe "(($1, $2) => { $1[\"g\"] = $2; })"
        js_setG :: GPUColorDict -> Double -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucolordict-g GPUColorDict.g specification>
setG :: (MonadDOM m) => GPUColorDict -> Double -> m ()
setG self val = liftDOM (void ((js_setG (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"g\"]; })"
        js_getG :: GPUColorDict -> IO Double
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucolordict-g GPUColorDict.g specification>
getG :: (MonadDOM m) => GPUColorDict -> m Double
getG self = liftDOM ((js_getG (self)))

foreign import javascript safe "(($1, $2) => { $1[\"b\"] = $2; })"
        js_setB :: GPUColorDict -> Double -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucolordict-b GPUColorDict.b specification>
setB :: (MonadDOM m) => GPUColorDict -> Double -> m ()
setB self val = liftDOM (void ((js_setB (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"b\"]; })"
        js_getB :: GPUColorDict -> IO Double
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucolordict-b GPUColorDict.b specification>
getB :: (MonadDOM m) => GPUColorDict -> m Double
getB self = liftDOM ((js_getB (self)))

foreign import javascript safe "(($1, $2) => { $1[\"a\"] = $2; })"
        js_setA :: GPUColorDict -> Double -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucolordict-a GPUColorDict.a specification>
setA :: (MonadDOM m) => GPUColorDict -> Double -> m ()
setA self val = liftDOM (void ((js_setA (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"a\"]; })"
        js_getA :: GPUColorDict -> IO Double
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucolordict-a GPUColorDict.a specification>
getA :: (MonadDOM m) => GPUColorDict -> m Double
getA self = liftDOM ((js_getA (self)))