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

Core.Utils

Description

 
Synopsis

Documentation

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

Splits a list into two lists: * The first one contains all the elements in odd positions * The second one contains all the elements in even positions

addXmlns :: Svg -> Svg Source #

Takes some Svg entity and adds two attributes: * xmlns="http://www.w3.org/2000/svg" * xmlns:xlink="http://www.w3.org/1999/xlink"

(.:) :: (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.