{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Diagrams.TwoD.Attributes (
Texture(..), solid, _SC, _AC, _LG, _RG, defaultLG, defaultRG
, GradientStop(..), stopColor, stopFraction, mkStops
, SpreadMethod(..), lineLGradient, lineRGradient
, LGradient(..), lGradStops, lGradTrans, lGradStart, lGradEnd
, lGradSpreadMethod, mkLinearGradient
, RGradient(..), rGradStops, rGradTrans
, rGradCenter0, rGradRadius0, rGradCenter1, rGradRadius1
, rGradSpreadMethod, mkRadialGradient
, LineTexture(..), _LineTexture, getLineTexture, lineTexture, lineTextureA
, mkLineTexture, _lineTexture
, lineColor, lc, lcA
, FillTexture(..), _FillTexture, getFillTexture, fillTexture
, mkFillTexture, _fillTexture, _fillTextureR
, fillColor, fc, fcA, recommendFillColor
, splitTextureFills
) where
import Control.Lens hiding (transform)
import Data.Colour hiding (AffineSpace, over)
import Data.Data
import Data.Default.Class
import Data.Monoid.Recommend
import Data.Semigroup
import Diagrams.Attributes
import Diagrams.Attributes.Compile
import Diagrams.Core
import Diagrams.Core.Types (RTree)
import Diagrams.Located (unLoc)
import Diagrams.Path (Path, pathTrails)
import Diagrams.Trail (isLoop)
import Diagrams.TwoD.Types
import Diagrams.Util
data GradientStop d = GradientStop
{ forall d. GradientStop d -> SomeColor
_stopColor :: SomeColor
, forall d. GradientStop d -> d
_stopFraction :: d
}
makeLensesWith (lensRules & generateSignatures .~ False) ''GradientStop
stopColor :: Lens' (GradientStop n) SomeColor
stopFraction :: Lens' (GradientStop n) n
data SpreadMethod = GradPad | GradReflect | GradRepeat
data LGradient n = LGradient
{ forall n. LGradient n -> [GradientStop n]
_lGradStops :: [GradientStop n]
, forall n. LGradient n -> Point V2 n
_lGradStart :: Point V2 n
, forall n. LGradient n -> Point V2 n
_lGradEnd :: Point V2 n
, forall n. LGradient n -> Transformation V2 n
_lGradTrans :: Transformation V2 n
, forall n. LGradient n -> SpreadMethod
_lGradSpreadMethod :: SpreadMethod }
type instance V (LGradient n) = V2
type instance N (LGradient n) = n
makeLensesWith (lensRules & generateSignatures .~ False) ''LGradient
instance Fractional n => Transformable (LGradient n) where
transform :: Transformation (V (LGradient n)) (N (LGradient n))
-> LGradient n -> LGradient n
transform = forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
over forall n. Lens' (LGradient n) (Transformation V2 n)
lGradTrans forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t. Transformable t => Transformation (V t) (N t) -> t -> t
transform
lGradStops :: Lens' (LGradient n) [GradientStop n]
lGradTrans :: Lens' (LGradient n) (Transformation V2 n)
lGradStart :: Lens' (LGradient n) (Point V2 n)
lGradEnd :: Lens' (LGradient n) (Point V2 n)
lGradSpreadMethod :: Lens' (LGradient n) SpreadMethod
data RGradient n = RGradient
{ forall n. RGradient n -> [GradientStop n]
_rGradStops :: [GradientStop n]
, forall n. RGradient n -> Point V2 n
_rGradCenter0 :: Point V2 n
, forall n. RGradient n -> n
_rGradRadius0 :: n
, forall n. RGradient n -> Point V2 n
_rGradCenter1 :: Point V2 n
, forall n. RGradient n -> n
_rGradRadius1 :: n
, forall n. RGradient n -> Transformation V2 n
_rGradTrans :: Transformation V2 n
, forall n. RGradient n -> SpreadMethod
_rGradSpreadMethod :: SpreadMethod }
makeLensesWith (lensRules & generateSignatures .~ False) ''RGradient
type instance V (RGradient n) = V2
type instance N (RGradient n) = n
instance Fractional n => Transformable (RGradient n) where
transform :: Transformation (V (RGradient n)) (N (RGradient n))
-> RGradient n -> RGradient n
transform = forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
over forall n. Lens' (RGradient n) (Transformation V2 n)
rGradTrans forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t. Transformable t => Transformation (V t) (N t) -> t -> t
transform
rGradStops :: Lens' (RGradient n) [GradientStop n]
rGradCenter0 :: Lens' (RGradient n) (Point V2 n)
rGradRadius0 :: Lens' (RGradient n) n
rGradCenter1 :: Lens' (RGradient n) (Point V2 n)
rGradRadius1 :: Lens' (RGradient n) n
rGradTrans :: Lens' (RGradient n) (Transformation V2 n)
rGradSpreadMethod :: Lens' (RGradient n) SpreadMethod
data Texture n = SC SomeColor | LG (LGradient n) | RG (RGradient n)
deriving Typeable
type instance V (Texture n) = V2
type instance N (Texture n) = n
makePrisms ''Texture
_AC :: Prism' (Texture n) (AlphaColour Double)
_AC :: forall n. Prism' (Texture n) (AlphaColour Double)
_AC = forall n. Prism' (Texture n) SomeColor
_SC forall b c a. (b -> c) -> (a -> b) -> a -> c
. Iso' SomeColor (AlphaColour Double)
_SomeColor
instance Floating n => Transformable (Texture n) where
transform :: Transformation (V (Texture n)) (N (Texture n))
-> Texture n -> Texture n
transform Transformation (V (Texture n)) (N (Texture n))
t (LG LGradient n
lg) = forall n. LGradient n -> Texture n
LG forall a b. (a -> b) -> a -> b
$ forall t. Transformable t => Transformation (V t) (N t) -> t -> t
transform Transformation (V (Texture n)) (N (Texture n))
t LGradient n
lg
transform Transformation (V (Texture n)) (N (Texture n))
t (RG RGradient n
rg) = forall n. RGradient n -> Texture n
RG forall a b. (a -> b) -> a -> b
$ forall t. Transformable t => Transformation (V t) (N t) -> t -> t
transform Transformation (V (Texture n)) (N (Texture n))
t RGradient n
rg
transform Transformation (V (Texture n)) (N (Texture n))
_ Texture n
sc = Texture n
sc
solid :: Color a => a -> Texture n
solid :: forall a n. Color a => a -> Texture n
solid = forall n. SomeColor -> Texture n
SC forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall c. Color c => c -> SomeColor
SomeColor
defaultLG :: Fractional n => Texture n
defaultLG :: forall n. Fractional n => Texture n
defaultLG = forall n. LGradient n -> Texture n
LG LGradient
{ _lGradStops :: [GradientStop n]
_lGradStops = []
, _lGradStart :: Point V2 n
_lGradStart = forall n. n -> n -> P2 n
mkP2 (-n
0.5) n
0
, _lGradEnd :: Point V2 n
_lGradEnd = forall n. n -> n -> P2 n
mkP2 n
0.5 n
0
, _lGradTrans :: Transformation V2 n
_lGradTrans = forall a. Monoid a => a
mempty
, _lGradSpreadMethod :: SpreadMethod
_lGradSpreadMethod = SpreadMethod
GradPad
}
defaultRG :: Fractional n => Texture n
defaultRG :: forall n. Fractional n => Texture n
defaultRG = forall n. RGradient n -> Texture n
RG RGradient
{ _rGradStops :: [GradientStop n]
_rGradStops = []
, _rGradCenter0 :: Point V2 n
_rGradCenter0 = forall n. n -> n -> P2 n
mkP2 n
0 n
0
, _rGradRadius0 :: n
_rGradRadius0 = n
0.0
, _rGradCenter1 :: Point V2 n
_rGradCenter1 = forall n. n -> n -> P2 n
mkP2 n
0 n
0
, _rGradRadius1 :: n
_rGradRadius1 = n
0.5
, _rGradTrans :: Transformation V2 n
_rGradTrans = forall a. Monoid a => a
mempty
, _rGradSpreadMethod :: SpreadMethod
_rGradSpreadMethod = SpreadMethod
GradPad
}
mkStops :: [(Colour Double, d, Double)] -> [GradientStop d]
mkStops :: forall d. [(Colour Double, d, Double)] -> [GradientStop d]
mkStops = forall a b. (a -> b) -> [a] -> [b]
map (\(Colour Double
x, d
y, Double
z) -> forall d. SomeColor -> d -> GradientStop d
GradientStop (forall c. Color c => c -> SomeColor
SomeColor (forall a. Num a => Colour a -> a -> AlphaColour a
withOpacity Colour Double
x Double
z)) d
y)
mkLinearGradient :: Num n => [GradientStop n] -> Point V2 n -> Point V2 n -> SpreadMethod -> Texture n
mkLinearGradient :: forall n.
Num n =>
[GradientStop n]
-> Point V2 n -> Point V2 n -> SpreadMethod -> Texture n
mkLinearGradient [GradientStop n]
stops Point V2 n
start Point V2 n
end SpreadMethod
spreadMethod
= forall n. LGradient n -> Texture n
LG (forall n.
[GradientStop n]
-> Point V2 n
-> Point V2 n
-> Transformation V2 n
-> SpreadMethod
-> LGradient n
LGradient [GradientStop n]
stops Point V2 n
start Point V2 n
end forall a. Monoid a => a
mempty SpreadMethod
spreadMethod)
mkRadialGradient :: Num n => [GradientStop n] -> Point V2 n -> n
-> Point V2 n -> n -> SpreadMethod -> Texture n
mkRadialGradient :: forall n.
Num n =>
[GradientStop n]
-> Point V2 n -> n -> Point V2 n -> n -> SpreadMethod -> Texture n
mkRadialGradient [GradientStop n]
stops Point V2 n
c0 n
r0 Point V2 n
c1 n
r1 SpreadMethod
spreadMethod
= forall n. RGradient n -> Texture n
RG (forall n.
[GradientStop n]
-> Point V2 n
-> n
-> Point V2 n
-> n
-> Transformation V2 n
-> SpreadMethod
-> RGradient n
RGradient [GradientStop n]
stops Point V2 n
c0 n
r0 Point V2 n
c1 n
r1 forall a. Monoid a => a
mempty SpreadMethod
spreadMethod)
newtype LineTexture n = LineTexture (Last (Texture n))
deriving (Typeable, NonEmpty (LineTexture n) -> LineTexture n
LineTexture n -> LineTexture n -> LineTexture n
forall b. Integral b => b -> LineTexture n -> LineTexture n
forall n. NonEmpty (LineTexture n) -> LineTexture n
forall n. LineTexture n -> LineTexture n -> LineTexture n
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
forall n b. Integral b => b -> LineTexture n -> LineTexture n
stimes :: forall b. Integral b => b -> LineTexture n -> LineTexture n
$cstimes :: forall n b. Integral b => b -> LineTexture n -> LineTexture n
sconcat :: NonEmpty (LineTexture n) -> LineTexture n
$csconcat :: forall n. NonEmpty (LineTexture n) -> LineTexture n
<> :: LineTexture n -> LineTexture n -> LineTexture n
$c<> :: forall n. LineTexture n -> LineTexture n -> LineTexture n
Semigroup)
instance (Typeable n) => AttributeClass (LineTexture n)
type instance V (LineTexture n) = V2
type instance N (LineTexture n) = n
_LineTexture :: Iso (LineTexture n) (LineTexture n')
(Texture n) (Texture n')
_LineTexture :: forall n n'.
Iso (LineTexture n) (LineTexture n') (Texture n) (Texture n')
_LineTexture = forall s a b t. (s -> a) -> (b -> t) -> Iso s t a b
iso forall n. LineTexture n -> Texture n
getLineTexture (forall n. Last (Texture n) -> LineTexture n
LineTexture forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> Last a
Last)
instance Floating n => Transformable (LineTexture n) where
transform :: Transformation (V (LineTexture n)) (N (LineTexture n))
-> LineTexture n -> LineTexture n
transform Transformation (V (LineTexture n)) (N (LineTexture n))
t (LineTexture (Last Texture n
tx)) = forall n. Last (Texture n) -> LineTexture n
LineTexture (forall a. a -> Last a
Last forall a b. (a -> b) -> a -> b
$ forall t. Transformable t => Transformation (V t) (N t) -> t -> t
transform Transformation (V (LineTexture n)) (N (LineTexture n))
t Texture n
tx)
instance Default (LineTexture n) where
def :: LineTexture n
def = forall n n'.
Iso (LineTexture n) (LineTexture n') (Texture n) (Texture n')
_LineTexture forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. Prism' (Texture n) SomeColor
_SC forall t b. AReview t b -> b -> t
## forall c. Color c => c -> SomeColor
SomeColor forall a. Num a => Colour a
black
mkLineTexture :: Texture n -> LineTexture n
mkLineTexture :: forall n. Texture n -> LineTexture n
mkLineTexture = forall n. Last (Texture n) -> LineTexture n
LineTexture forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> Last a
Last
getLineTexture :: LineTexture n -> Texture n
getLineTexture :: forall n. LineTexture n -> Texture n
getLineTexture (LineTexture (Last Texture n
t)) = Texture n
t
lineTexture :: (InSpace V2 n a, Typeable n, Floating n, HasStyle a) => Texture n -> a -> a
lineTexture :: forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
Texture n -> a -> a
lineTexture = forall a d.
(AttributeClass a, Transformable a, V a ~ V d, N a ~ N d,
HasStyle d) =>
a -> d -> d
applyTAttr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. Last (Texture n) -> LineTexture n
LineTexture forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> Last a
Last
lineTextureA :: (InSpace V2 n a, Typeable n, Floating n, HasStyle a) => LineTexture n -> a -> a
lineTextureA :: forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
LineTexture n -> a -> a
lineTextureA = forall a d.
(AttributeClass a, Transformable a, V a ~ V d, N a ~ N d,
HasStyle d) =>
a -> d -> d
applyTAttr
_lineTexture :: (Floating n, Typeable n) => Lens' (Style V2 n) (Texture n)
_lineTexture :: forall n.
(Floating n, Typeable n) =>
Lens' (Style V2 n) (Texture n)
_lineTexture = forall a (v :: * -> *) n.
(V a ~ v, N a ~ n, AttributeClass a, Transformable a) =>
Lens' (Style v n) (Maybe a)
atTAttr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> (a -> Bool) -> Iso' (Maybe a) a
anon forall a. Default a => a
def forall {n'}. LineTexture n' -> Bool
isDef forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n n'.
Iso (LineTexture n) (LineTexture n') (Texture n) (Texture n')
_LineTexture
where
isDef :: LineTexture n' -> Bool
isDef = forall s a. Getting Any s a -> (a -> Bool) -> s -> Bool
anyOf (forall n n'.
Iso (LineTexture n) (LineTexture n') (Texture n) (Texture n')
_LineTexture forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. Prism' (Texture n) (AlphaColour Double)
_AC) (forall a. Eq a => a -> a -> Bool
== forall a. Num a => Colour a -> AlphaColour a
opaque forall a. Num a => Colour a
black)
lineColor :: (InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) => c -> a -> a
lineColor :: forall n a c.
(InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) =>
c -> a -> a
lineColor = forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
Texture n -> a -> a
lineTexture forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. SomeColor -> Texture n
SC forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall c. Color c => c -> SomeColor
SomeColor
lc :: (InSpace V2 n a, Typeable n, Floating n, HasStyle a) => Colour Double -> a -> a
lc :: forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
Colour Double -> a -> a
lc = forall n a c.
(InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) =>
c -> a -> a
lineColor
lcA :: (InSpace V2 n a, Typeable n, Floating n, HasStyle a) => AlphaColour Double -> a -> a
lcA :: forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
AlphaColour Double -> a -> a
lcA = forall n a c.
(InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) =>
c -> a -> a
lineColor
lineLGradient :: (InSpace V2 n a, Typeable n, Floating n, HasStyle a) => LGradient n -> a -> a
lineLGradient :: forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
LGradient n -> a -> a
lineLGradient LGradient n
g = forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
Texture n -> a -> a
lineTexture (forall n. LGradient n -> Texture n
LG LGradient n
g)
lineRGradient :: (InSpace V2 n a, Typeable n, Floating n, HasStyle a) => RGradient n -> a -> a
lineRGradient :: forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
RGradient n -> a -> a
lineRGradient RGradient n
g = forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
Texture n -> a -> a
lineTexture (forall n. RGradient n -> Texture n
RG RGradient n
g)
newtype FillTexture n = FillTexture (Recommend (Last (Texture n)))
deriving (Typeable, NonEmpty (FillTexture n) -> FillTexture n
FillTexture n -> FillTexture n -> FillTexture n
forall b. Integral b => b -> FillTexture n -> FillTexture n
forall n. NonEmpty (FillTexture n) -> FillTexture n
forall n. FillTexture n -> FillTexture n -> FillTexture n
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
forall n b. Integral b => b -> FillTexture n -> FillTexture n
stimes :: forall b. Integral b => b -> FillTexture n -> FillTexture n
$cstimes :: forall n b. Integral b => b -> FillTexture n -> FillTexture n
sconcat :: NonEmpty (FillTexture n) -> FillTexture n
$csconcat :: forall n. NonEmpty (FillTexture n) -> FillTexture n
<> :: FillTexture n -> FillTexture n -> FillTexture n
$c<> :: forall n. FillTexture n -> FillTexture n -> FillTexture n
Semigroup)
instance Typeable n => AttributeClass (FillTexture n)
_FillTexture :: Iso' (FillTexture n) (Recommend (Texture n))
_FillTexture :: forall n. Iso' (FillTexture n) (Recommend (Texture n))
_FillTexture = forall s a b t. (s -> a) -> (b -> t) -> Iso s t a b
iso forall {n}. FillTexture n -> Recommend (Texture n)
getter forall {n}. Recommend (Texture n) -> FillTexture n
setter
where
getter :: FillTexture n -> Recommend (Texture n)
getter (FillTexture (Recommend (Last Texture n
t))) = forall a. a -> Recommend a
Recommend Texture n
t
getter (FillTexture (Commit (Last Texture n
t))) = forall a. a -> Recommend a
Commit Texture n
t
setter :: Recommend (Texture n) -> FillTexture n
setter (Recommend Texture n
t) = forall n. Recommend (Last (Texture n)) -> FillTexture n
FillTexture (forall a. a -> Recommend a
Recommend (forall a. a -> Last a
Last Texture n
t))
setter (Commit Texture n
t) = forall n. Recommend (Last (Texture n)) -> FillTexture n
FillTexture (forall a. a -> Recommend a
Commit (forall a. a -> Last a
Last Texture n
t))
type instance V (FillTexture n) = V2
type instance N (FillTexture n) = n
instance Floating n => Transformable (FillTexture n) where
transform :: Transformation (V (FillTexture n)) (N (FillTexture n))
-> FillTexture n -> FillTexture n
transform = forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
over (forall n. Iso' (FillTexture n) (Recommend (Texture n))
_FillTexture forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Lens (Recommend a) (Recommend b) a b
_recommend) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t. Transformable t => Transformation (V t) (N t) -> t -> t
transform
instance Default (FillTexture n) where
def :: FillTexture n
def = forall n. Texture n -> FillTexture n
mkFillTexture forall a b. (a -> b) -> a -> b
$ forall n. Prism' (Texture n) (AlphaColour Double)
_AC forall t b. AReview t b -> b -> t
## forall a. Num a => AlphaColour a
transparent
getFillTexture :: FillTexture n -> Texture n
getFillTexture :: forall n. FillTexture n -> Texture n
getFillTexture (FillTexture Recommend (Last (Texture n))
tx) = forall a. Last a -> a
getLast forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Recommend a -> a
getRecommend forall a b. (a -> b) -> a -> b
$ Recommend (Last (Texture n))
tx
fillTexture :: (InSpace V2 n a, Typeable n, Floating n, HasStyle a) => Texture n -> a -> a
fillTexture :: forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
Texture n -> a -> a
fillTexture = forall a d.
(AttributeClass a, Transformable a, V a ~ V d, N a ~ N d,
HasStyle d) =>
a -> d -> d
applyTAttr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. Texture n -> FillTexture n
mkFillTexture
mkFillTexture :: Texture n -> FillTexture n
mkFillTexture :: forall n. Texture n -> FillTexture n
mkFillTexture = forall n. Recommend (Last (Texture n)) -> FillTexture n
FillTexture forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> Recommend a
Commit forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> Last a
Last
_fillTextureR :: (Typeable n, Floating n) => Lens' (Style V2 n) (Recommend (Texture n))
_fillTextureR :: forall n.
(Typeable n, Floating n) =>
Lens' (Style V2 n) (Recommend (Texture n))
_fillTextureR = forall a (v :: * -> *) n.
(V a ~ v, N a ~ n, AttributeClass a, Transformable a) =>
Lens' (Style v n) (Maybe a)
atTAttr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> (a -> Bool) -> Iso' (Maybe a) a
anon forall a. Default a => a
def forall {n}. FillTexture n -> Bool
isDef forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. Iso' (FillTexture n) (Recommend (Texture n))
_FillTexture
where
isDef :: FillTexture n -> Bool
isDef = forall s a. Getting Any s a -> (a -> Bool) -> s -> Bool
anyOf (forall n. Iso' (FillTexture n) (Recommend (Texture n))
_FillTexture forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Prism' (Recommend a) a
_Recommend forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. Prism' (Texture n) (AlphaColour Double)
_AC) (forall a. Eq a => a -> a -> Bool
== forall a. Num a => AlphaColour a
transparent)
_fillTexture :: (Typeable n, Floating n) => Lens' (Style V2 n) (Texture n)
_fillTexture :: forall n.
(Typeable n, Floating n) =>
Lens' (Style V2 n) (Texture n)
_fillTexture = forall n.
(Typeable n, Floating n) =>
Lens' (Style V2 n) (Recommend (Texture n))
_fillTextureR forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Iso (Recommend a) (Recommend b) a b
committed
fillColor :: (InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) => c -> a -> a
fillColor :: forall n a c.
(InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) =>
c -> a -> a
fillColor = forall n a.
(InSpace V2 n a, Typeable n, Floating n, HasStyle a) =>
Texture n -> a -> a
fillTexture forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. SomeColor -> Texture n
SC forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall c. Color c => c -> SomeColor
SomeColor
recommendFillColor :: (InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) => c -> a -> a
recommendFillColor :: forall n a c.
(InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) =>
c -> a -> a
recommendFillColor =
forall a d.
(AttributeClass a, Transformable a, V a ~ V d, N a ~ N d,
HasStyle d) =>
a -> d -> d
applyTAttr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. Recommend (Last (Texture n)) -> FillTexture n
FillTexture forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> Recommend a
Recommend forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> Last a
Last forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. SomeColor -> Texture n
SC forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall c. Color c => c -> SomeColor
SomeColor
fc :: (InSpace V2 n a, Floating n, Typeable n, HasStyle a) => Colour Double -> a -> a
fc :: forall n a.
(InSpace V2 n a, Floating n, Typeable n, HasStyle a) =>
Colour Double -> a -> a
fc = forall n a c.
(InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) =>
c -> a -> a
fillColor
fcA :: (InSpace V2 n a, Floating n, Typeable n, HasStyle a) => AlphaColour Double -> a -> a
fcA :: forall n a.
(InSpace V2 n a, Floating n, Typeable n, HasStyle a) =>
AlphaColour Double -> a -> a
fcA = forall n a c.
(InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) =>
c -> a -> a
fillColor
data FillTextureLoops n = FillTextureLoops
instance Typeable n => SplitAttribute (FillTextureLoops n) where
type AttrType (FillTextureLoops n) = FillTexture n
type PrimType (FillTextureLoops n) = Path V2 n
primOK :: FillTextureLoops n -> PrimType (FillTextureLoops n) -> Bool
primOK FillTextureLoops n
_ = forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all (forall (v :: * -> *) n. Trail v n -> Bool
isLoop forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Located a -> a
unLoc) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (v :: * -> *) n. Path v n -> [Located (Trail v n)]
pathTrails
splitTextureFills
:: forall b v n a. (
Typeable n) => RTree b v n a -> RTree b v n a
splitTextureFills :: forall b (v :: * -> *) n a.
Typeable n =>
RTree b v n a -> RTree b v n a
splitTextureFills = forall code b (v :: * -> *) n a.
SplitAttribute code =>
code -> RTree b v n a -> RTree b v n a
splitAttr (forall n. FillTextureLoops n
FillTextureLoops :: FillTextureLoops n)