NodeBox

Create visual output with Python programming code
Home Download Reference Tutorial Library Gallery About

colors.Color

Description

An item inside a Colors list. A Color behaves like an ordinary Python list, but with added functionality: it has a name and a weight (which ranges between 0.0 and 1.0 and represents the color's dominance in the total set). The higher its weight, the more it appears in the top of the Colors list.

Each item in a Color list is a Shade.

Example

import colors
c = colors.colors("sky", top=3)
for color in c:
  print color.name, color.weight
>>>blue 0.908263560248
>>>red 0.0809974517656
>>>orange 0.0107389879869