Colour Picker RGB YIQ#

rgb-yiq class#

Construction four gradients in rgba three gradients in yiq.

  • Using PPM image spinbox validation

  • Working with modified Scale and colour space

class rgbandyiq.RgbYiqSelect(fr0, enlargement)#

Bases: object

Class to construct yiq, rgba gradients, final colour

and yiq colour space

Parameters:

fr (str) -- parent widget

ahandle(*evt)#

Command callback for alpha,

Parameters:

evt (str) -- command handle

build()#

widget construction

checkhash(evt=None)#

Procedure called by entry for hash

Parameters:

evt=None (str) -- bind handles

checksb(evt=None)#

Procedure called by rgb colour spinboxes

Parameters:

evt=None (str) -- bind handles

checksba(evt=None)#

Procedure called by alpha spinbox

Parameters:

evt=None (str) -- bind handles

checksyiq(evt=None)#

Procedure called by yiq spinboxes

Parameters:

evt=None (str) -- bind handles

door_bell(ring)#

Bind callback from cursor.

Parameters:

ring (tuple of int) -- y, i, q values

iqhandle(*evt)#

Command callback for i.

Parameters:

evt (str) -- command handle

move_ring(event)#

Procedure called when mouse clicked or dragged in colour space

Parameters:

evt=None (str) -- bind handle

Return type:

calls handle for cursor

overlord(rgb=None, hasho=None, yiq=None)#

Supervisory procedure to control calls from handles

Parameters:
  • rgb (tuple of integers) -- rgb

  • yiq (tuple of integers) -- yiq

Return type:

draws gradients and sets other colour system

related(y, i, q)#
resize(event, can='')#
resize_yiq(event, can='')#
rgbhandle(evt=None)#

command callback for red, green, blue

yhandle(*evt)#

Command callback for y.

Parameters:

evt (str) -- command handle

class rgbandyiq.TtkScale(parent, length, from_=0, to=255, orient='horizontal', variable=0, digits=None, tickinterval=None, sliderlength=16, command=None)#

Bases: Scale

Class to draw themed Scale widget.

Parameters:
  • parent (str) -- parent widget

  • from (int) -- start of scale

  • to (int) -- end of scale

  • length (int) -- length in pixels

  • orient (str) -- orientation

  • variable (str) -- tk variable

  • digits (int) -- length variable when converted to string

  • tickinterval (float or int) -- how many digits show up in tick interval

  • sliderlength (int) -- what it says

  • command (str) -- procedure called when slider moves

build(parent, from_, to, sliderlength, tickinterval, length)#

Create ttk Scale ticks.

Parameters:
  • parent (str) -- parent widget

  • from (int) -- start of scale

  • to (int) -- end of scale

  • length (int) -- length in pixels

  • tickinterval (float or int)