svg-icons-0.4.0.2: Svg Icons and more
Safe HaskellSafe-Inferred
LanguageHaskell2010

Core.Utils

Synopsis

Documentation

evenOddSplit :: [a] -> ([a], [a]) Source #

Splits a list xs into two lists:

  • The first one contains all odd positioned elements of xs
  • The second one contains all even positioned elements of xs

addXmlns :: Svg -> Svg Source #

Takes some Svg entity and adds two attributes:

(.:) :: (AttributeValue -> Attribute) -> Float -> Attribute infixl 5 Source #

Handy operator that converts a Float number into an AttributeValue and feeds it to the Attribute function. Example:

S.path 
  ! (A.strokeWidth .: 0.1) 

distance :: (Float, Float) -> (Float, Float) -> Float Source #

Euclidian distance between two points.

horizontalMirrorMatrix :: AttributeValue Source #

Matrix for the horizontal symmetry respect to the axis x=0. Use it with the transform Attribute:

S.path
  ! A.transform horizontalMirrorMatrix

verticalMirrorMatrix :: AttributeValue Source #

Matrix for the vertical symmetry respect to the axis y=0. Use it with the transform Attribute:

S.path
  ! A.transform (verticalMirrorMatrix <> rotateAround 45 0 0)

frame :: Float -> Float -> Float -> Float -> Svg Source #

frame is mainly used for testing purposes.

Takes the 4 numbers of the viewbox (x0, y0, width, height) and returns a path with a very thin stroke which connects all consecutive corners of the viewbox and also connects opposite middle points of the sides of the viewbox.

cleanDecimals :: Int -> String -> String Source #

Please ignore this function.