@startuml
abstract SPaintEngine
SPainter *-- SPaintEngine
SCanvasPaintEngine ..|> SPaintEngine
SSvgPaintEngine ..|> SPaintEngine
SPaintEngine "1" -- "n" SPaintState
SBrush -- SPaintState
SBrush "1" -- "1" SColor
SBrush "1" -- "1" SGradient
SLineGradient ..|> SGradient
SRadialGradient ..|> SGradient
SPainter "1" *-- "1" SBrush

class SBrush{
    color: SColor
    type: SBrushType
    gradient: SGradient
    constructor(SBrush):void
    constructor(SColor):void
    constructor(SGradient):void
    constructor():void
}

class SPaintState{
    brush: SBrush
    font: SFont
    matrix: SMatrix
    pen: SPen
    composite: SComposite
    constructor(SPaintState): void
}

class SColor{
    alpha: number
    red: number
    green: number
    blue: number
    constructor(number | string | SColor, number, number, number): void
    rgb(number, number, number): SColor
    rgba(number, number, number, number): SColor
}

class SGradient{
    stopList: SGradientStop[]
    addColorStop(number, SColor): void
}

@enduml
