Colors#
- class ansys.stk.core.utilities.colors.Colors#
object
A factory for creating Color objects that may be used with the Object Model.
Contains factory methods and named colors.
Overview#
Examples#
Get and set a four-channel color for the graphics of an STK graphics primitive
from ansys.stk.core.utilities.colors import Colors, ColorRGBA
manager = root.current_scenario.scene_manager
point = manager.initializers.point_batch_primitive.initialize()
lla_pts = [39.88, -75.25, 0, 38.85, -77.04, 0, 37.37, -121.92, 0]
colors = [Colors.Red, ColorRGBA(Colors.Blue, 127), Colors.from_rgba(0, 255, 0, 127)]
point.set_cartographic_with_colors("Earth", lla_pts, colors)
Get and set a three-channel color for the graphics of an STK graphics primitive
from ansys.stk.core.stkobjects import STKObjectType
from ansys.stk.core.utilities.colors import Color, Colors
facility = root.current_scenario.children.new(STKObjectType.FACILITY, "facility1")
facility.graphics.color = Colors.Blue
facility.graphics.color = Color.from_rgb(127, 255, 212)
(r, g, b) = facility.graphics.color.get_rgb()
Import detail#
from ansys.stk.core.utilities.colors import Colors
Method detail#
- Colors.from_argb()#
Create a new Color from an arbitrary number of values in the range [0, 255], inferred from the arguments provided.