Changeset View
Changeset View
Standalone View
Standalone View
doc/python_api/examples/mathutils.Color.py
| Show All 20 Lines | |||||
| # colors can be added and subtracted | # colors can be added and subtracted | ||||
| col += mathutils.Color((0.25, 0.0, 0.0)) | col += mathutils.Color((0.25, 0.0, 0.0)) | ||||
| # Color can be multiplied, in this example color is scaled to 0-255 | # Color can be multiplied, in this example color is scaled to 0-255 | ||||
| # can printed as integers | # can printed as integers | ||||
| print("Color: %d, %d, %d" % (col * 255.0)[:]) | print("Color: %d, %d, %d" % (col * 255.0)[:]) | ||||
| # This example prints the color as hexidecimal | # This example prints the color as hexadecimal | ||||
| print("Hexidecimal: %.2x%.2x%.2x" % (col * 255.0)[:]) | print("Hexadecimal: %.2x%.2x%.2x" % (col * 255.0)[:]) | ||||