【问题标题】:Is there any way I can pick a color of a surface using H.S.V?有什么方法可以使用 H.S.V 选择表面颜色吗?
【发布时间】:2020-09-06 15:11:55
【问题描述】:
if mouse_check_button_pressed(mb_left) && pickMode = true 
{
    hue = surface_getpixel ( artSurface [ pages ] , mouse_x , mouse_y ); 
    saturation = surface_getpixel ( artSurface [ pages ] , mouse_x , mouse_y ); 
    value = surface_getpixel ( artSurface [ pages ] , mouse_x , mouse_y );
}

有什么方法可以使用 H.S.V 选择表面颜色?
这是说当你按下鼠标按钮并且pickMode在颜色上时,颜色将是鼠标坐标下的颜色。 pickMode 是通过按“P”来激活的。

有多个页面,因此您可以制作动画,这就是表面是数组的原因。 https://paste.mod.gg/teceguqiva.cs

【问题讨论】:

    标签: gml game-maker-studio-2


    【解决方案1】:

    如果您想从表面像素中获取 HSV,请获取像素颜色,然后对其使用 color_* 函数:

    var col = surface_getpixel ( artSurface [ pages ] , mouse_x , mouse_y );
    var hue = color_get_hue(col);
    var sat = color_get_saturation(col);
    var val = color_get_value(col);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-23
      • 2016-03-28
      • 2012-10-31
      • 1970-01-01
      • 1970-01-01
      • 2021-09-15
      相关资源
      最近更新 更多