Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions samples/colour-canvas-game/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Colour Memory Game

## Summary

A single player colour memory game built in Power Apps. A random colour appears on screen for a few seconds. The colour disappears and the player uses Red, Green, and Blue sliders to recreate the colour they saw. A score out of 10 is given based on how close the guess was to the original colour.

![Intro Screen](assets/start.png)
![Colour Screen](assets/colour.png)
![Guess Screen](assets/colourpick.png)
![Result Screen](assets/result.png)

## Applies to

![Power Apps](https://img.shields.io/badge/Power%20Apps-Yes-green "Yes")
![Power Automate](https://img.shields.io/badge/Power%20Automate-No-red "No")
![Power BI](https://img.shields.io/badge/Power%20BI-No-red "No")
![Power Pages](https://img.shields.io/badge/Power%20Pages-No-red "No")
![Power Virtual Agents](https://img.shields.io/badge/Power%20Virtual%20Agents-No-red "No")
![Dataverse](https://img.shields.io/badge/Dataverse-No-red "No")
![AI Builder](https://img.shields.io/badge/AI%20Builder-No-red "No")
![Custom Connectors](https://img.shields.io/badge/Custom%20Connectors-No-red "No")
![Power Fx](https://img.shields.io/badge/Power%20Fx-Yes-green "Yes")

## Compatibility

![Premium License](https://img.shields.io/badge/Premium%20License-Not%20Required-red.svg "Premium license not required")
![Experimental Features](https://img.shields.io/badge/Experimental%20Features-No-red.svg "Does not rely on experimental features")

## Contributors

* [joshua](https://github.com/brayjosh)

## Version history

Version|Date|Comments
-------|----|--------
1.0|June 8, 2025|Initial release

## Prerequisites

None. No connectors, no Dataverse, no premium licence required.

## Minimal path to awesome

### Using the solution zip

* [Download](./solution/ColourCanvasGame.zip) the `.zip` from the `solution` folder
* Within **Power Apps Studio**, import the solution `.zip` file using **Solutions** > **Import Solution** and select the `.zip` file you just downloaded
* Open the app and select **Play**

### Using the source code

* Clone the repository to a local drive
* Pack the source files back into a solution `.zip` file:

```bash
pac solution pack --zipfile ColourCanvasGame.zip --folder sourcecode --processCanvasApps
```

* Within **Power Apps Studio**, import the solution `.zip` file using **Solutions** > **Import Solution** and select the `.zip` file you just packed

## Features

A fun and lightweight game that demonstrates creative use of Power Fx and canvas app controls without any external data sources or premium features.

* Random colour generation using `RGBA` and `RandBetween`
* Colour distance scoring using Euclidean distance in RGB space
* Timer controls for countdown and colour display
* Dynamic background colour updated live from slider values

## Help

We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.

If you encounter any issues while using this sample, you can [create a new issue](https://github.com/pnp/powerplatform-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=bug-report.yml&sample=colour-canvas-game&authors=@brayjosh&title=colour-canvas-game%20-%20).

For questions regarding this sample, [create a new question](https://github.com/pnp/powerplatform-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=question.yml&sample=colour-canvas-game&authors=@brayjosh&title=colour-canvas-game%20-%20).

Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/powerplatform-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=suggestion.yml&sample=colour-canvas-game&authors=@brayjosh&title=colour-canvas-game%20-%20).

## Disclaimer

**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

<img src="https://m365-visitor-stats.azurewebsites.net/powerplatform-samples/samples/colour-canvas-game" aria-hidden="true" />
Binary file added samples/colour-canvas-game/assets/colour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/colour-canvas-game/assets/colourpick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/colour-canvas-game/assets/result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions samples/colour-canvas-game/assets/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[
{
"name": "pnp-powerplatform-samples-colour-canvas-game",
"source": "pnp",
"title": "Colour Canvas Game",
"shortDescription": "A Power Apps game that challenges players to memorise a colour and recreate it from memory as accurately as possible.",
"url": "https://github.com/pnp/powerplatform-samples/tree/main/samples/colour-canvas-game",
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/powerplatform-samples/tree/main/samples/colour-canvas-game",
"longDescription": [
"Colour Canvas Game is a Power Apps Canvas App that tests a player's ability to remember and recreate colours from memory.",
"Players are briefly shown a randomly generated colour before attempting to recreate it using colour selection controls.",
"The solution demonstrates Power Apps game mechanics, timers, variables, collections, colour calculations, and custom scoring logic implemented using Power Fx."
],
"creationDateTime": "2026-06-08",
"updateDateTime": "2026-06-08",
"products": [
"Power Apps"
],
"tags": [
"game",
"colour",
"color",
"memory",
"canvas app",
"power fx"
],
"categories": [
"CANVAS"
],
"metadata": [
{
"key": "POWERAPPS-EXPERIMENTAL",
"value": "No"
},
{
"key": "POWERAPPS-PREMIUM",
"value": "No"
},
{
"key": "POWERAPPS-ONPREM",
"value": "No"
},
{
"key": "POWERAPPS-CUSTOMCONNECTOR",
"value": "No"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://github.com/pnp/powerplatform-samples/raw/main/samples/colour-canvas-game/assets/start.png",
"alt": "Colour Canvas Game preview"
}
],
"authors": [
{
"gitHubAccount": "brayjosh",
"pictureUrl": "https://github.com/brayjosh.png",
"name": "joshua"
}
],
"references": [
{
"name": "Microsoft Power Platform documentation",
"description": "Discover how to make the most of Microsoft Power Platform products with online training courses, documentation, and videos.",
"url": "https://learn.microsoft.com/power-platform/"
}
]
}
]
Binary file added samples/colour-canvas-game/assets/start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# msbuild output directories
/bin
/obj

# MSBuild Binary and Structured Log
*.binlog
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PowerAppsTargetsPath>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\PowerApps</PowerAppsTargetsPath>
</PropertyGroup>

<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<Import Project="$(PowerAppsTargetsPath)\Microsoft.PowerApps.VisualStudio.Solution.props" Condition="Exists('$(PowerAppsTargetsPath)\Microsoft.PowerApps.VisualStudio.Solution.props')" />

<PropertyGroup>
<ProjectGuid>433b7241-77ac-466e-be3b-eccdf0b82fb5</ProjectGuid>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<!--Remove TargetFramework when this is available in 16.1-->
<TargetFramework>net462</TargetFramework>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<SolutionRootPath>src</SolutionRootPath>
</PropertyGroup>

<!--
Solution Packager overrides, un-comment to use: SolutionPackagerType (Managed, Unmanaged, Both)
Solution Localization Control, if you want to enabled localization of your solution, un-comment SolutionPackageEnableLocalization and set the value to true. - Requires use of -loc flag on Solution Clone or Sync
-->
<!--
<PropertyGroup>
<SolutionPackageType>Managed</SolutionPackageType>
<SolutionPackageEnableLocalization>false</SolutionPackageEnableLocalization>
</PropertyGroup>
-->

<ItemGroup>
<PackageReference Include="Microsoft.PowerApps.MSBuild.Solution" Version="1.*" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\.gitignore" />
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\bin\**" />
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\obj\**" />
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\*.cdsproj" />
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\*.cdsproj.user" />
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\*.sln" />
</ItemGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)\**" Exclude="@(ExcludeDirectories)" />
<Content Include="$(SolutionPackageZipFilePath)">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
<Import Project="$(PowerAppsTargetsPath)\Microsoft.PowerApps.VisualStudio.Solution.targets" Condition="Exists('$(PowerAppsTargetsPath)\Microsoft.PowerApps.VisualStudio.Solution.targets')" />

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<CanvasApp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Name>bj_colour_3a462</Name>
<AppVersion>2026-07-15T18:14:09Z</AppVersion>
<Status>Ready</Status>
<CreatedByClientVersion>3.26065.8.0</CreatedByClientVersion>
<MinClientVersion>3.26065.8.0</MinClientVersion>
<Tags>{"primaryDeviceWidth":"1527","primaryDeviceHeight":"629","supportsPortrait":"true","supportsLandscape":"true","primaryFormFactor":"Tablet","showStatusBar":"false","publisherVersion":"3.26065.8","minimumRequiredApiVersion":"2.2.0","hasComponent":"false","hasUnlockedComponent":"false","isUnifiedRootApp":"false","m365CopilotSettingValue":"0","sienaVersion":"20260608T175800Z-3.26054.13.0"}</Tags>
<IsCdsUpgraded>0</IsCdsUpgraded>
<GalleryItemId xsi:nil="true"></GalleryItemId>
<BackgroundColor>RGBA(0,176,240,1)</BackgroundColor>
<DisplayName>colour</DisplayName>
<Description xsi:nil="true"></Description>
<CommitMessage xsi:nil="true"></CommitMessage>
<Publisher xsi:nil="true"></Publisher>
<AuthorizationReferences>[]</AuthorizationReferences>
<ConnectionReferences>{}</ConnectionReferences>
<DatabaseReferences>{}</DatabaseReferences>
<AppComponents>[]</AppComponents>
<AppComponentDependencies>[]</AppComponentDependencies>
<CanConsumeAppPass>1</CanConsumeAppPass>
<CanvasAppType>0</CanvasAppType>
<BypassConsent>0</BypassConsent>
<AdminControlBypassConsent>0</AdminControlBypassConsent>
<EmbeddedApp xsi:nil="true"></EmbeddedApp>
<IntroducedVersion>1.0</IntroducedVersion>
<CdsDependencies>{"cdsdependencies":[]}</CdsDependencies>
<IsCustomizable>1</IsCustomizable>
<BackgroundImageUri>/CanvasApps/bj_colour_3a462_BackgroundImageUri</BackgroundImageUri>
<DocumentUri>/CanvasApps/bj_colour_3a462_DocumentUri.msapp</DocumentUri>
<AdditionalUris>
<AdditionalUri>/CanvasApps/bj_colour_3a462_AdditionalUris0_identity.json</AdditionalUri>
</AdditionalUris>
</CanvasApp>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"__Version":"0.1","App":"0ddfb624-21ec-4071-ad61-fbc3ca001f3b","Test_7F478737223C4B69":"c87a718a-8968-4a28-9d48-9468d3b5ffeb","Host":"30cd9de0-562c-42de-b807-ee54d3604429","scrStart":"96164a96-7811-46f3-b6ab-d94914b0ff72","conHome":"d7d9db13-7440-4304-8255-d2b72b2359b0","lblColour":"ef1c4843-e212-4ba7-8522-84c43ca09506","lblColour_1":"6045196f-cfa3-44bd-aa1e-4a4c036dbfd5","icoArrow":"79e2fae7-7a3e-4ba7-b145-43eeb224244b","scrColour":"678b4f19-abc1-4d1e-a29b-84fc265a2256","conInfo":"dc4f3a4c-21a8-4103-ac02-5a7c99bdb5f7","lblAnswer":"0592e01a-8e8f-4f59-a683-cb614078534c","lblReady":"2ae8e406-e1e9-4ef9-96b7-4757291ffe38","lblSet":"1ef6f2ef-4910-493b-b2bd-60eaad22615d","lblGo":"4981daea-f97d-42c6-8d7d-b312615e6970","lblTime":"8c1e2433-3c66-4a6e-9c5e-4bb55f10eaf4","tmrCountdown":"54e01032-6f58-4b0c-9cc7-47819778796c","tmrReadySetGo":"8ef1e1f3-c604-4e4e-98d2-c58b1d834298","scrColourPick":"02e35fc2-5f76-4e42-a75d-1fe385dec96a","conSliders":"dfda1af3-1700-4932-aced-08001e7dde2b","conTopFill":"97aabb9a-0452-4f64-9859-df92b1328f61","conRed":"9c149353-cdfe-4dc8-a5bc-a91d5463042e","lblRed":"bf282ad0-80da-4735-9131-29e7b3cb53a1","sldRed":"1aaecee8-b431-4e35-8af6-149a32e9fad3","conGreen":"06333429-74d8-44e6-bab4-b0f9d1d9893d","lblGreen":"d8382053-9141-4000-ac21-f765748694c0","sldGreen":"446ad481-5a47-426b-ae63-4d18bcd928e5","conBlue":"6dc90f8b-4ae2-4806-b0f2-3328349190c8","lblBlue":"959836bc-a671-407c-9f6d-b1dc73d8a377","sldBlue":"db5a697e-d051-4020-b05a-771bf93e7877","conBottomFill":"f196d189-d811-4b9c-9266-4453d184e438","icoGuess":"f79bb55d-c94e-4232-8f32-2ca3f9d1c624","scrResult":"ac46ac59-1352-485c-85b5-e98e0aa4dab6","conColours":"c8e3d5c9-7351-411d-bc48-8bfd35a05f4c","lblResult":"3f3ae869-0733-49c0-a11a-e813255170eb","conGuess":"1f1c272a-d1d2-4b57-b7b1-176df882e3e2","conLeftFill":"65083b7f-c5bd-4841-8d2c-babd681cc0a8","conOptions":"3105b635-62ab-471f-8dfc-239993521a49","icoHome":"cb69c2c9-e795-41f5-b6a6-eba54a7bb99f","icoReset":"c3dc1c1d-7174-48e3-82ad-19a137980e1d"}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<ImportExportXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" OrganizationVersion="9.2.26063.162" OrganizationSchemaType="Standard" CRMServerServiceabilityVersion="9.2.26063.00162">
<Entities />
<Roles />
<Workflows />
<FieldSecurityProfiles />
<Templates />
<EntityMaps />
<EntityRelationships />
<OrganizationSettings />
<optionsets />
<CustomControls />
<EntityDataProviders />
<CanvasApps />
<Languages>
<Language>1033</Language>
</Languages>
</ImportExportXml>
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<ImportExportXml version="9.2.26063.162" SolutionPackageVersion="9.2" languagecode="1033" generatedBy="CrmLive" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" OrganizationVersion="9.2.26063.162" OrganizationSchemaType="Standard" CRMServerServiceabilityVersion="9.2.26063.00162">
<SolutionManifest>
<UniqueName>ColourCanvasGame</UniqueName>
<LocalizedNames>
<LocalizedName description="Colour Canvas Game" languagecode="1033" />
</LocalizedNames>
<Descriptions />
<Version>1.0.0.1</Version>
<Managed>2</Managed>
<Publisher>
<UniqueName>brayjosh</UniqueName>
<LocalizedNames>
<LocalizedName description="brayjosh" languagecode="1033" />
</LocalizedNames>
<Descriptions />
<EMailAddress xsi:nil="true"></EMailAddress>
<SupportingWebsiteUrl xsi:nil="true"></SupportingWebsiteUrl>
<CustomizationPrefix>bj</CustomizationPrefix>
<CustomizationOptionValuePrefix>12120</CustomizationOptionValuePrefix>
<Addresses>
<Address>
<AddressNumber>1</AddressNumber>
<AddressTypeCode>1</AddressTypeCode>
<City xsi:nil="true"></City>
<County xsi:nil="true"></County>
<Country xsi:nil="true"></Country>
<Fax xsi:nil="true"></Fax>
<FreightTermsCode xsi:nil="true"></FreightTermsCode>
<ImportSequenceNumber xsi:nil="true"></ImportSequenceNumber>
<Latitude xsi:nil="true"></Latitude>
<Line1 xsi:nil="true"></Line1>
<Line2 xsi:nil="true"></Line2>
<Line3 xsi:nil="true"></Line3>
<Longitude xsi:nil="true"></Longitude>
<Name xsi:nil="true"></Name>
<PostalCode xsi:nil="true"></PostalCode>
<PostOfficeBox xsi:nil="true"></PostOfficeBox>
<PrimaryContactName xsi:nil="true"></PrimaryContactName>
<ShippingMethodCode>1</ShippingMethodCode>
<StateOrProvince xsi:nil="true"></StateOrProvince>
<Telephone1 xsi:nil="true"></Telephone1>
<Telephone2 xsi:nil="true"></Telephone2>
<Telephone3 xsi:nil="true"></Telephone3>
<TimeZoneRuleVersionNumber xsi:nil="true"></TimeZoneRuleVersionNumber>
<UPSZone xsi:nil="true"></UPSZone>
<UTCOffset xsi:nil="true"></UTCOffset>
<UTCConversionTimeZoneCode xsi:nil="true"></UTCConversionTimeZoneCode>
</Address>
<Address>
<AddressNumber>2</AddressNumber>
<AddressTypeCode>1</AddressTypeCode>
<City xsi:nil="true"></City>
<County xsi:nil="true"></County>
<Country xsi:nil="true"></Country>
<Fax xsi:nil="true"></Fax>
<FreightTermsCode xsi:nil="true"></FreightTermsCode>
<ImportSequenceNumber xsi:nil="true"></ImportSequenceNumber>
<Latitude xsi:nil="true"></Latitude>
<Line1 xsi:nil="true"></Line1>
<Line2 xsi:nil="true"></Line2>
<Line3 xsi:nil="true"></Line3>
<Longitude xsi:nil="true"></Longitude>
<Name xsi:nil="true"></Name>
<PostalCode xsi:nil="true"></PostalCode>
<PostOfficeBox xsi:nil="true"></PostOfficeBox>
<PrimaryContactName xsi:nil="true"></PrimaryContactName>
<ShippingMethodCode>1</ShippingMethodCode>
<StateOrProvince xsi:nil="true"></StateOrProvince>
<Telephone1 xsi:nil="true"></Telephone1>
<Telephone2 xsi:nil="true"></Telephone2>
<Telephone3 xsi:nil="true"></Telephone3>
<TimeZoneRuleVersionNumber xsi:nil="true"></TimeZoneRuleVersionNumber>
<UPSZone xsi:nil="true"></UPSZone>
<UTCOffset xsi:nil="true"></UTCOffset>
<UTCConversionTimeZoneCode xsi:nil="true"></UTCConversionTimeZoneCode>
</Address>
</Addresses>
</Publisher>
<RootComponents>
<RootComponent type="300" schemaName="bj_colour_3a462" behavior="0" />
</RootComponents>
<MissingDependencies />
</SolutionManifest>
</ImportExportXml>
Loading