Skip to content

danielgamage/DrawBotModules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DrawBotModules

DrawBot modules I make / use

from DrawBotModules import Color

fg = Color.hex('#face')
bg = Color.hex('223344')

Color

Color.hex(string)

The Color.hex interface parses hex strings into DrawBot-compatible RGBA floats. It supports several formats:

  • #rgb
  • #rgba
  • #rrggbb
  • #rrggbbaa

In all cases, the leading hashbang (#) is optional

The class then exposes the following properties:

Color.r int

Color.g int

Color.b int

Color.a int

Default: 1

Color.tuple tuple

Default: (Color.r, Color.g, Color.b, Color.a)

With this, you can either manually insert rgba values or splat / spread the tuple into a DrawBot fill/stroke function:

fg = Color.Hex('#002B36')
t = FormattedString()
t.fill(*fg.tuple)

About

DrawBot modules I make / use

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages