mono / VulkanSharp

Open source .NET binding for the Vulkan API
MIT License
537 stars 61 forks source link

Create new VkColor.as for fast choose color :) #73

Open ghost opened 6 years ago

ghost commented 6 years ago

Hello everyone,

I am happy because I have got color like any OpenTK, SharpDX and OpenGL.net now Vulkan Caution Vulkan will get eruption and lava are colorable :D using Vulkan;

namespace ClearView.Common
{
    // Vulkan's color like any fast colors from OpenTK, SharpDX and more...
    class VkColor : ClearColorValue
    {
        public VkColor(float red, float green, float blue, float alpha)
        {
            Float32 = new float[] { red, green, blue, alpha };
        }

        public static VkColor Red
        {
            get
            {
                return new VkColor(1.0f, 0.0f, 0.0f, 1.0f);
            }
        }

        public static VkColor CornflowerBlue
        {
            get
            {
                return new VkColor(0.392f, 0.584f, 0.929f, 1.0f);
            }
        }

        public static VkColor Yellow
        {
            get
            {
                return new VkColor(1.0f, 1.0f, 0.0f, 1.0f);
            }
        }

        public static VkColor Orange
        {
            get
            {
                return new VkColor(1.0f, 0.5f, 0.0f, 1.0f);
            }
        }
.....
    }
}

Than you can have to choose fast without problem with float float float float. just write fast color if you like... Thanks for support!