本文整理汇总了Python中myrmidon.Game.hsva_to_colour方法的典型用法代码示例。如果您正苦于以下问题:Python Game.hsva_to_colour方法的具体用法?Python Game.hsva_to_colour怎么用?Python Game.hsva_to_colour使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myrmidon.Game
的用法示例。
在下文中一共展示了Game.hsva_to_colour方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_lowering_saturation_increases_appropriate_rgb_channels_uniformally
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import hsva_to_colour [as 别名]
def test_lowering_saturation_increases_appropriate_rgb_channels_uniformally(self, engines):
engines["gfx"].rgb_to_colour = self._stub_colour
result = Game.hsva_to_colour(60, 0.25, 1.0, 255)
self.assertAlmostEqual(1.0, result[0], 2)
self.assertAlmostEqual(1.0, result[1], 2)
self.assertAlmostEqual(0.75, result[2], 2)
self.assertEqual(1.0, result[3])
示例2: test_lowering_val_lowers_appropriate_rgb_channels_uniformally
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import hsva_to_colour [as 别名]
def test_lowering_val_lowers_appropriate_rgb_channels_uniformally(self, engines):
engines['gfx'].rgb_to_colour = self._stub_colour
result = Game.hsva_to_colour(60, 1.0, 0.25, 255)
self.assertAlmostEqual(0.25, result[0], 2)
self.assertAlmostEqual(0.25, result[1], 2)
self.assertAlmostEqual(0.0, result[2], 2)
self.assertEqual(1.0, result[3])
示例3: test_returns_correct_alpha_value
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import hsva_to_colour [as 别名]
def test_returns_correct_alpha_value(self, engines):
engines["gfx"].rgb_to_colour = self._stub_colour
self.assertAlmostEqual(0.25, Game.hsva_to_colour(0, 1.0, 1.0, 64)[3], 2)
示例4: test_returns_magenta_for_hue_300
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import hsva_to_colour [as 别名]
def test_returns_magenta_for_hue_300(self, engines):
engines["gfx"].rgb_to_colour = self._stub_colour
self.assertEqual((1.0, 0.0, 1.0, 1.0), Game.hsva_to_colour(300, 1.0, 1.0, 255))
示例5: test_returns_cyan_for_hue_180
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import hsva_to_colour [as 别名]
def test_returns_cyan_for_hue_180(self, engines):
engines["gfx"].rgb_to_colour = self._stub_colour
self.assertEqual((0.0, 1.0, 1.0, 1.0), Game.hsva_to_colour(180, 1.0, 1.0, 255))
示例6: test_returns_yellow_for_hue_60
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import hsva_to_colour [as 别名]
def test_returns_yellow_for_hue_60(self, engines):
engines["gfx"].rgb_to_colour = self._stub_colour
self.assertEqual((1.0, 1.0, 0.0, 1.0), Game.hsva_to_colour(60, 1.0, 1.0, 255))
示例7: test_returns_black_for_no_val
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import hsva_to_colour [as 别名]
def test_returns_black_for_no_val(self, engines):
engines["gfx"].rgb_to_colour = self._stub_colour
self.assertEqual((0.0, 0.0, 0.0, 1.0), Game.hsva_to_colour(0, 1.0, 0.0, 255))
示例8: test_returns_white_for_no_sat_and_full_val
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import hsva_to_colour [as 别名]
def test_returns_white_for_no_sat_and_full_val(self, engines):
engines["gfx"].rgb_to_colour = self._stub_colour
self.assertEqual((1.0, 1.0, 1.0, 1.0), Game.hsva_to_colour(0, 0.0, 1.0, 255))
示例9: test_returns_blue_for_hue_240
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import hsva_to_colour [as 别名]
def test_returns_blue_for_hue_240(self, engines):
engines['gfx'].rgb_to_colour = self._stub_colour
self.assertEqual((0.0, 0.0, 1.0, 1.0), Game.hsva_to_colour(240, 1.0, 1.0, 255))