New in version 0.1.2.
Color value.
Unlike any other objects in Wand, its resource management can be implicit when it used outside of with block. In these case, its resource are allocated for every operation which requires a resource and destroyed immediately. Of course it is inefficient when the operations are much, so to avoid it, you should use color objects inside of with block explicitly e.g.:
red_count = 0
with Color('#f00') as red:
with Image(filename='image.png') as img:
for row in img:
for col in row:
if col == red:
red_count += 1
Parameters: | string (basestring) – a color namel string e.g. 'rgb(255, 255, 255)', '#fff', 'white'. see ImageMagick Color Names doc also |
---|
See also
Equality operator.
Param other: | a color another one |
---|---|
Type color: | Color |
Returns : | True only if two images equal. |
Rtype : | bool |
(numbers.Real) Alpha value, from 0.0 to 1.0.
(numbers.Real) Blue, from 0.0 to 1.0.
Raw level version of equality test function for two pixels.
Parameters: |
|
---|---|
Returns: | True only if two pixels equal |
Return type: | bool |
Note
It’s only for internal use. Don’t use it directly. Use == operator of Color instead.
(numbers.Real) Green, from 0.0 to 1.0.
(numbers.Real) Red, from 0.0 to 1.0.
(basestring) The string representation of the color.